1pub fn linear(t: f64) -> f64 {
2 t
3}
4
5pub fn ease_in_quad(t: f64) -> f64 {
6 t * t
7}
8
9pub fn ease_out_quad(t: f64) -> f64 {
10 t * (2.0 - t)
11}
12
13pub fn ease_in_out_quad(t: f64) -> f64 {
14 if t < 0.5 {
15 2.0 * t * t
16 } else {
17 -1.0 + (4.0 - 2.0 * t) * t
18 }
19}
20
21pub fn ease_in_cubic(t: f64) -> f64 {
22 t * t * t
23}
24
25pub fn ease_out_cubic(t: f64) -> f64 {
26 let t = t - 1.0;
27 t * t * t + 1.0
28}
29
30pub fn ease_in_out_cubic(t: f64) -> f64 {
31 if t < 0.5 {
32 4.0 * t * t * t
33 } else {
34 let t = t - 1.0;
35 1.0 + 4.0 * t * t * t
36 }
37}