Last active
October 2, 2021 14:14
-
-
Save AugustMiller/85b54d49493bb71ba81e to your computer and use it in GitHub Desktop.
Map a number in one range to a number in another.
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
function mapNumber (number, inMin, inMax, outMin, outMax) { | |
return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; | |
} |
i don't understand , plz explain for me , thanks you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. Came in handy