emath

Function remap

source
pub fn remap<T>(
    x: T,
    from: impl Into<RangeInclusive<T>>,
    to: impl Into<RangeInclusive<T>>,
) -> T
where T: Real,
Expand description

Linearly remap a value from one range to another, so that when x == from.start() returns to.start() and when x == from.end() returns to.end().