normie
normalise value btw 2 ranges, yay
breaking change !
if you were using v1, order of the argument changed, as V2 provide currying value and ranges have swapped
usage
normie takes up to three argument and return either a result or a normalisation function
Name | Type | Attributes | Description |
---|---|---|---|
r1 | Array of numbers | range of the initial value | |
r2 | Array of numbers | range of the initial scale | |
value | number | optional | value to convert |
if you provide 3 argument normie will give you a normalised result
const n = console // will give 90
if you provide only 2 argument normie will give you a function that will take a single argument, and output a normalised value
const n = const toDeg = console // will give 90