Map a value from one range to another
将一个值从一个范围映射到另一个范围
The value to map. 要映射的值
The minimum of the input range. 输入范围的最小值
The maximum of the input range. 输入范围的最大值
The minimum of the output range. 输出范围的最小值
The maximum of the output range. 输出范围的最大值
The mapped value. 映射后的值
mapRange(5, 0, 10, 0, 100) // => 50mapRange(0, 0, 10, 0, 100) // => 0mapRange(10, 0, 10, 0, 100) // => 100 Copy
mapRange(5, 0, 10, 0, 100) // => 50mapRange(0, 0, 10, 0, 100) // => 0mapRange(10, 0, 10, 0, 100) // => 100
Map a value from one range to another
将一个值从一个范围映射到另一个范围