1 2 3 4 5 6 7 8 9 10 11
/// An extension trait for `f32`.
pub trait F64Ext {
/// Linearly interpolate between `self` and `other` with parameter `t`.
fn ext_lerp(self, other: f64, t: f64) -> f64;
}
impl F64Ext for f64 {
fn ext_lerp(self, other: f64, t: f64) -> f64 {
self * (1.0 - t) + other * t
}
}