Inverse operation of linear interpolation. Given a range and a value, returns the interpolation amount to get that value. @param min Lowest value in the range @param max Highest value in the range @param value Value in the range @returns Interpolation amount from 0.0 to 1.0 (or beyond if `x` i
(min: number, max: number, value: number)
| 8 | @returns Interpolation amount from 0.0 to 1.0 (or beyond if `x` is outside the range [min, max]) |
| 9 | */ |
| 10 | function inverseLinearInterpolation(min: number, max: number, value: number): number { |
| 11 | if (min === max) { |
| 12 | return 0; |
| 13 | } |
| 14 | |
| 15 | return (value - min) / (max - min); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | Create a function that calculates a GitHub heat index based on a list of numbers. |
no outgoing calls
no test coverage detected