// Standard easing curves for animation. Each takes progress `t` in [0, 1] and
// returns the eased value. Import with: import "std/ease" as ease; then call
// ease::smooth(t), ease::in_out_quad(t), and so on.
fn smooth(t) {
t * t * (3.0 - 2.0 * t)
}
fn in_quad(t) {
t * t
}
fn out_quad(t) {
1.0 - (1.0 - t) * (1.0 - t)
}
fn in_out_quad(t) {
if t < 0.5 {
2.0 * t * t
} else {
let u = 1.0 - t;
1.0 - 2.0 * u * u
}
}
fn in_cubic(t) {
t * t * t
}
fn out_cubic(t) {
let u = 1.0 - t;
1.0 - u * u * u
}
fn in_out_cubic(t) {
if t < 0.5 {
4.0 * t * t * t
} else {
let u = 1.0 - t;
1.0 - 4.0 * u * u * u
}
}