emath: Add quadratic_in_inverse

This commit is contained in:
Varphone Wong
2024-06-07 09:27:32 +08:00
parent 94b15f0593
commit f9df09b53d
+8
View File
@@ -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()
}
/// <https://easings.net/#easeOutQuad>
///
/// Same as `1.0 - quadratic_in(1.0 - t)`.