use crate::easing::Curve;
#[derive(Debug)]
pub struct InSextic;
impl Curve for InSextic {
#[inline]
fn y(&self, p: f32) -> f32 {
p * p * p * p * p * p
}
}
#[test]
fn test_in_sextic() {
let p = InSextic.y(1.0);
assert_eq!(p, 1.0);
}
#[derive(Debug)]
pub struct OutSextic;
impl Curve for OutSextic {
#[inline]
fn y(&self, p: f32) -> f32 {
let m = p - 1.0;
1.0 - m * m * m * m * m * m
}
}
#[test]
fn test_out_sextic() {
let p = OutSextic.y(1.0);
assert_eq!(p, 1.0);
}
#[derive(Debug)]
pub struct InOutSextic;
impl Curve for InOutSextic {
#[inline]
fn y(&self, p: f32) -> f32 {
let m = p - 1.0;
let t = p * 2.0;
if t < 1.0 {
return p * t * t * t * t * t;
}
1.0 - m * m * m * m * m * m * 32.0
}
}
#[test]
fn test_in_out_sextic() {
let p = InOutSextic.y(1.0);
assert_eq!(p, 1.0);
}