pub fn lerp_clamped<T: PartialOrd + Num + Copy>(a: T, b: T, t: T) -> T
Expand description

Linearly interpolates between a and b by t. Clamps ‘t’ between 0 and 1.

Examples

assert_eq!(lerp_clamped(0, 1, 2), 1);
assert_eq!(lerp_clamped(0.0, 1.0, -0.01), 0.0);