pub fn ease(curve: impl Curve, time: f32, start: f32, end: f32) -> f32Expand description
§The Ease Function.
Interpolates between start and end using the given easing curve.
Zero-cost for static easing types (monomorphized at compile time).
Also works with trait objects thanks to the blanket impl for &T.
§examples.
use eazy::{ease, Curve, Easing};
use eazy::polynomial::quadratic::InQuadratic;
// Static type (zero-cost, inlined).
let value = ease(InQuadratic, 0.5, 0.0, 100.0);
// Easing enum.
let value = ease(Easing::InQuadratic, 0.5, 0.0, 100.0);
// Reference.
let easing = Easing::OutBounce;
let value = ease(&easing, 0.5, 0.0, 100.0);
// Trait object.
let curve: &dyn Curve = &Easing::InElastic;
let value = ease(curve, 0.5, 0.0, 100.0);