Created
October 6, 2020 09:23
-
-
Save jade-itworkswhy/0f0a5c2f52425c73314ef50e5bc61598 to your computer and use it in GitHub Desktop.
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
Number.prototype.map = function(in_min, in_max, out_min, out_max) { | |
return ((this - 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