If the denominator is 0 the output will be 0 otherwise normal division occurs.
Fits a number into a new range of values.
the number to convert
the minimum value of the number's current range
the maximum value of the number's current range
the minimum value of the desired range
the maximum value of the desired range.
Measures how close two points, on two separate ranges, are to each other. It should be noted that the relative proximity will be more pronounced on larger ranges, requiring a relatively larger distance between points to measure a lower proximity.
NOTE: This assumes ranges with a min value of 1.
a point along the x-range
a point along the y-range
the maximum value in the x-range
the maximum value in the y-range
a value close to 1 indicates they are very close. A value close to 0 indicates they are as var away as possible.
The "median" is the "middle" value in the list of numbers.
an array of numbers
Moves a value toward 1 in order to reduce it's effect in multiplication and division. This is the inverse of scaleUp.
Scales scales a value up to 1. Setting a scale factor of 1 will return 1. A scale factor of 0 will return the original value.
the number to scale. Must be between 0 and 1 inclusive.
The amount to scale by. Must be between 0 and 1 inclusive.
Generated using TypeDoc
calculates the average value of an array of numbers