Skip to main content

Module easing

Module easing 

Source
Expand description

All easing functions for the Animato animation library.

Two ways to use easing:

  1. Easing enum — storable, passable, optionally serializable:

    use animato_core::Easing;
    let e = Easing::EaseOutCubic;
    let v = e.apply(0.5);
  2. Free functions — zero-overhead, inlined at call site:

    use animato_core::easing::ease_out_cubic;
    let v = ease_out_cubic(0.5);

§Invariants

All named variants satisfy:

  • apply(0.0) == 0.0
  • apply(1.0) == 1.0
  • t outside [0.0, 1.0] is clamped — no panic

Enums§

Easing
All 31 classic easing variants, CSS-compatible parameterized variants, and an escape-hatch Custom function pointer.

Functions§

cubic_bezier
CSS-compatible cubic Bezier easing.
custom_bounce
Configurable bounce easing.
ease_in_back
Back ease-in — overshoots slightly then pulls back.
ease_in_bounce
Bounce ease-in.
ease_in_circ
Circular ease-in.
ease_in_cubic
Cubic ease-in:
ease_in_elastic
Elastic ease-in — spring-like oscillation at the beginning.
ease_in_expo
Exponential ease-in.
ease_in_out_back
Back ease-in-out.
ease_in_out_bounce
Bounce ease-in-out.
ease_in_out_circ
Circular ease-in-out.
ease_in_out_cubic
Cubic ease-in-out.
ease_in_out_elastic
Elastic ease-in-out.
ease_in_out_expo
Exponential ease-in-out.
ease_in_out_quad
Quadratic ease-in-out.
ease_in_out_quart
Quartic ease-in-out.
ease_in_out_quint
Quintic ease-in-out.
ease_in_out_sine
Sinusoidal ease-in-out.
ease_in_quad
Quadratic ease-in:
ease_in_quart
Quartic ease-in: t⁴
ease_in_quint
Quintic ease-in: t⁵
ease_in_sine
Sinusoidal ease-in.
ease_out_back
Back ease-out — overshoots the target then settles.
ease_out_bounce
Bounce ease-out — ball bouncing to rest.
ease_out_circ
Circular ease-out.
ease_out_cubic
Cubic ease-out: 1 - (1-t)³
ease_out_elastic
Elastic ease-out — spring-like oscillation at the end.
ease_out_expo
Exponential ease-out.
ease_out_quad
Quadratic ease-out: 1 - (1-t)²
ease_out_quart
Quartic ease-out: 1 - (1-t)⁴
ease_out_quint
Quintic ease-out: 1 - (1-t)⁵
ease_out_sine
Sinusoidal ease-out.
expo_scale
Exponential scale easing: warps time according to an exponential curve.
rough_ease
Rough, organic easing using deterministic sine harmonics.
slow_mo
Slow-motion easing: fast at edges, slow in the middle.
steps
CSS steps(n, jump-end) easing.
wiggle
Wiggle easing: oscillates around the linear trend with a sine envelope.