simple_easing/quart.rs
1/// <https://easings.net/#easeInQuart>
2pub fn quart_in(t: f32) -> f32 {
3 t * t * t * t
4}
5
6/// <https://easings.net/#easeOutQuart>
7pub fn quart_out(t: f32) -> f32 {
8 1.0 - (1.0 - t).powi(4)
9}
10
11/// <https://easings.net/#easeInOutQuart>
12pub fn quart_in_out(t: f32) -> f32 {
13 if t < 0.5 {
14 8.0 * t * t * t * t
15 } else {
16 1.0 - (-2.0 * t + 2.0).powi(4) / 2.0
17 }
18}