Expand description
There are a few ports of Robert Penner’s easing functions in crates.io
. This one is different
in that all functions take a t ∈ [0, 1]
and return a value in the interval [0, 1]
.
Derived from https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c
Functions§
- back_in
- Modeled after the overshooting cubic y = x^3-xsin(xpi)
- back_
in_ out - Modeled after the piecewise overshooting cubic function:
- back_
out - Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)*sin((1-x)*pi))
- bounce_
in - Each bounce is modelled as a parabola
- bounce_
in_ out - Each bounce is modelled as a parabola
- bounce_
out - Each bounce is modelled as a parabola
- circular_
in - Modeled after shifted quadrant IV of unit circle
- circular_
in_ out - Modeled after the piecewise circular function
- circular_
out - Modeled after shifted quadrant II of unit circle
- cubic_
in - Modeled after the cubic y = x^3
- cubic_
in_ out - Modeled after the piecewise cubic
- cubic_
out - Modeled after the cubic y = (x - 1)^3 + 1
- elastic_
in - Modeled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1))
- elastic_
in_ out - Modeled after the piecewise exponentially-damped sine wave:
- elastic_
out - Modeled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1
- exponential_
in - Modeled after the exponential function y = 2^(10(x - 1))
- exponential_
in_ out - Modeled after the piecewise exponential
- exponential_
out - Modeled after the exponential function y = -2^(-10x) + 1
- linear
- Modeled after the line
y = x
- quadratic_
in - Modeled after the parabola
y = x^2
- quadratic_
in_ out - Modeled after the piecewise quadratic
- quadratic_
out - Modeled after the parabola
y = -x^2 + 2x
- quartic_
in - Modeled after the quartic y = x^4
- quartic_
in_ out - Modeled after the piecewise quartic
- quartic_
out - Modeled after the quartic y = 1 - (x - 1)^4
- quintic_
in - Modeled after the quintic y = x^5
- quintic_
in_ out - Modeled after the piecewise quintic
- quintic_
out - Modeled after the quintic y = (x - 1)^5 + 1
- sin_in
- Modeled after quarter-cycle of sine wave
- sin_
in_ out - Modeled after half sine wave
- sin_out
- Modeled after quarter-cycle of sine wave (different phase)