Update mapNumRange.md

This commit is contained in:
Yusof Bandar
2019-02-22 23:19:17 +00:00
committed by GitHub
parent 372115a21f
commit 56d4b4ddca

View File

@ -2,7 +2,7 @@
Maps a number from one range to another range.
Returns `num` mapped between `out_min` to `out_max` from `in_min` to `in_max`
Returns `num` mapped between `out_min`-`out_max` from `in_min`-`in_max`
```js
const distance = (num, in_min, in_max, out_min, out_max) => (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
```