Function remap
Source pub fn remap<T: Real>(x: T, in_lo: T, in_hi: T, out_lo: T, out_hi: T) -> T
Expand description
Remap x from range [in_lo, in_hi] to [out_lo, out_hi].
Alias for map_range with clearer naming.
ยงExamples
use mathverse_core::ops::remap;
assert_eq!(remap(5.0, 0.0, 10.0, 0.0, 100.0), 50.0);
assert_eq!(remap(0.0, 0.0, 10.0, 0.0, 100.0), 0.0);