Skip to content

Instantly share code, notes, and snippets.

@eightlines
Created April 2, 2014 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eightlines/9934973 to your computer and use it in GitHub Desktop.
Save eightlines/9934973 to your computer and use it in GitHub Desktop.
MapFloat
float mapfloat(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