Created
April 2, 2014 14:11
-
-
Save eightlines/9934973 to your computer and use it in GitHub Desktop.
MapFloat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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