Crate easings

Source
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)