Created
June 26, 2024 11:54
-
-
Save pdaug/39c24964327de9f65306df0278332dc9 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
// 64 - 1024 | |
// x | |
// 256 - 2048 | |
const remap = function (x: number, inputMinimum: number, inputMaximum: number, outputMinimum: number, outputMaximum: number) { | |
const pointA = (x - inputMinimum) * (outputMaximum - outputMinimum); | |
const pointB = (inputMaximum - inputMinimum) + outputMinimum; | |
const result = pointA / pointB; | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment