1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

emath: Add quadratic_in_inverse

This commit is contained in:
Varphone Wong
2024-06-07 09:27:32 +08:00
parent 1e7b59cfd4
commit a4e93324f1

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)`.