diff --git a/crates/emath/src/easing.rs b/crates/emath/src/easing.rs index 352c451c2..e8d566741 100644 --- a/crates/emath/src/easing.rs +++ b/crates/emath/src/easing.rs @@ -26,6 +26,14 @@ pub fn quadratic_in(t: f32) -> f32 { t * t } +/// Inverse of `quadratic_in`. +/// +/// This is not the same as `1.0 - quadratic_in(t)`. +#[inline] +pub fn quadratic_in_inverse(y: f32) -> f32 { + y.sqrt() +} + /// /// /// Same as `1.0 - quadratic_in(1.0 - t)`.