pub fn lerp<R, T>(range: impl Into<RangeInclusive<R>>, t: T) -> R
Expand description
Linear interpolation.
assert_eq!(lerp(1.0..=5.0, 0.0), 1.0);
assert_eq!(lerp(1.0..=5.0, 0.5), 3.0);
assert_eq!(lerp(1.0..=5.0, 1.0), 5.0);
assert_eq!(lerp(1.0..=5.0, 2.0), 9.0);