use crate::easing::Curve;
#[derive(Debug)]
pub struct InSeptic;
impl Curve for InSeptic {
#[inline]
fn y(&self, p: f32) -> f32 {
p * p * p * p * p * p * p
}
}
#[test]
fn test_in_septic() {
let p = InSeptic.y(1.0);
assert_eq!(p, 1.0);
}
#[derive(Debug)]
pub struct OutSeptic;
impl Curve for OutSeptic {
#[inline]
fn y(&self, p: f32) -> f32 {
let m = p - 1.0;
1.0 + m * m * m * m * m * m * m
}
}
#[test]
fn test_out_septic() {
let p = OutSeptic.y(1.0);
assert_eq!(p, 1.0);
}
#[derive(Debug)]
pub struct InOutSeptic;
impl Curve for InOutSeptic {
#[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 * t;
}
1.0 + m * m * m * m * m * m * m * 64.0
}
}
#[test]
fn test_in_out_septic() {
let p = InOutSeptic.y(1.0);
assert_eq!(p, 1.0);
}