Normalises an array. By default uses the actual min/max of the array as the normalisation range. ixfx Guide on Normalising
import {Normalise} from 'https://unpkg.com/ixfx/dist/numbers.js'// Yields: [0.5, 0.1, 0.0, 0.9, 1]Normalise.array([5,1,0,9,10]); Copy
import {Normalise} from 'https://unpkg.com/ixfx/dist/numbers.js'// Yields: [0.5, 0.1, 0.0, 0.9, 1]Normalise.array([5,1,0,9,10]);
minForced and/or maxForced can be provided to use an arbitrary range.
minForced
maxForced
// Forced range 0-100// Yields: [0.05, 0.01, 0.0, 0.09, 0.10]Normalise.array([5,1,0,9,10], 0, 100); Copy
// Forced range 0-100// Yields: [0.05, 0.01, 0.0, 0.09, 0.10]Normalise.array([5,1,0,9,10], 0, 100);
Return values are clamped to always be 0-1, inclusive.
Values
Optional
If provided, this will be min value used
If provided, this will be the max value used
Normalises an array. By default uses the actual min/max of the array as the normalisation range. ixfx Guide on Normalising
minForced
and/ormaxForced
can be provided to use an arbitrary range.Return values are clamped to always be 0-1, inclusive.