Utils.normalize()
Convert the number given as first parameter to a number from zero to one that indicates where it lies in the range given as second and third parameters
Parameters
Name | Type | Description | |
---|---|---|---|
1 | x | number | |
2 | min | number | |
3 | max | number |
Return value
number
the result
Usage
import {Utils} from '@lcluber/type6js';
let number = 2;
let normalize = Utils.normalize(number, 1, 4);
console.log(normalize); //0.33333