Created
January 16, 2016 19:29
-
-
Save mortenjust/9b30b310e62f86fba11e to your computer and use it in GitHub Desktop.
processing-like map()
This file contains hidden or 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
static float rangeMap(float value, float low1, float low2, float high1, float high2){ | |
return low2 + (value - low1) * (high2 - low2) / (high1 - low1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment