Namespace
An array of numbers to be normalized.
The minimum value of the desired range.
The maximum value of the desired range.
An array containing the normalized values.
const data = [10, 15, 12, 14, 8];
const normalizedData = normalizeArray(data, 0, 1);
console.log(normalizedData); // Output: [0.375, 0.875, 0.5, 0.75, 0]
Generated using TypeDoc
ArrayUtils
Normalize an array of numbers to the specified range.
This function takes an array of numbers and normalizes it to a specified range [min, max]. The normalization is performed using the formula: (x - min) / (max - min). The resulting normalized value will lie between 0 and 1, inclusive, if all numbers in the original array are within the range [min, max].