Utils.map()
Interpolate the number given as first parameter between boundaies given as second and third parameter then map it to boundaries given as fourth and fifth parameters
Parameters
Name | Type | Description | |
---|---|---|---|
1 | x | number | |
2 | sourceMin | number | |
3 | sourceMax | number | |
4 | destMin | number | |
5 | destMax | number |
Return value
number
the result
Usage
import {Utils} from '@lcluber/type6js';
let map = Utils.map(100, 0, 1080, 20, 340);
console.log(map);