Skip to content

Instantly share code, notes, and snippets.

@drewandre
Created March 30, 2020 20:28
Show Gist options
  • Save drewandre/0bfcb76e5ad785308ea5ec740d857bf8 to your computer and use it in GitHub Desktop.
Save drewandre/0bfcb76e5ad785308ea5ec740d857bf8 to your computer and use it in GitHub Desktop.
float map(float x, float in_min, float in_max, float out_min, float out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment