pub fn map_range<T: Real>(x: T, in_lo: T, in_hi: T, out_lo: T, out_hi: T) -> TExpand description
Map a value from one range to another.
map_range(x, 0, 10, 0, 100) maps 5 to 50.
ยงExamples
use mathverse_core::ops::map_range;
assert_eq!(map_range(5.0, 0.0, 10.0, 0.0, 100.0), 50.0);
assert_eq!(map_range(0.0, 0.0, 10.0, 0.0, 100.0), 0.0);