pub fn linlin<T: Float>(
value: T,
from_min: T,
from_max: T,
to_min: T,
to_max: T,
) -> T
Expand description
Map an input value from one range to another.
It performs clipping on the input value in the range of from_min
and from_max
.
Using generics, this function can map any type that implements the Into
trait.
Note: If the denominator is zero, the function will return to_min
to avoid division by zero.