Skip to content
FutureBlitz

    Install

    Import std.math.easing

    std.math.easing

    Easing curves for animation, from 0 at the start to 1 at the end.

    Easing: how far along an animation is at a time t from 0 to 1, from 0 at its start to 1 at its end, for each of the usual curves, as easings.net draws them. In starts slow and ends fast, Out starts fast and ends slow, and InOut does both, each half a curve's In and Out. Back overshoots below 0 or past 1, Elastic springs past them, and Bounce bounces.

    Examples

    // Each goes from 0 at 0 to 1 at 1.
    Expect(EaseInSine(0) == 0.0 && EaseOutSine(1) == 1.0 && EaseInOutSine(0.5) == 0.5)
    Expect(EaseInCubic(0.5) == 0.125 && EaseOutCubic(0.5) == 0.875)
    Expect(EaseOutBounce(1) == 1.0 && EaseInElastic(0) == 0.0 && EaseInBack(0.5) < 0)

    std/math/easing.fb

    Functions

    EaseInSine function

    Public Function EaseInSine(t: Float): Float

    Along a quarter of a sine wave.

    std/math/easing.fb, line 27

    EaseOutSine function

    Public Function EaseOutSine(t: Float): Float

    Out along a quarter of a sine wave.

    std/math/easing.fb, line 29

    EaseInOutSine function

    Public Function EaseInOutSine(t: Float): Float

    In and out along a quarter of a sine wave.

    std/math/easing.fb, line 31

    EaseInQuad function

    Public Function EaseInQuad(t: Float): Float

    t squared.

    std/math/easing.fb, line 34

    EaseOutQuad function

    Public Function EaseOutQuad(t: Float): Float

    Out along t squared.

    std/math/easing.fb, line 36

    EaseInOutQuad function

    Public Function EaseInOutQuad(t: Float): Float

    In and out along t squared.

    Examples

    Expect(EaseInOutQuad(0) == 0.0 && EaseInOutQuad(1) == 1.0)
    Expect(EaseInOutQuad(0.5) == 0.5)
    Expect(EaseInQuad(0.5) == 0.25 && EaseOutQuad(0.5) == 0.75)

    std/math/easing.fb, line 46

    EaseInCubic function

    Public Function EaseInCubic(t: Float): Float

    t cubed.

    std/math/easing.fb, line 49

    EaseOutCubic function

    Public Function EaseOutCubic(t: Float): Float

    Out along t cubed.

    std/math/easing.fb, line 51

    EaseInOutCubic function

    Public Function EaseInOutCubic(t: Float): Float

    In and out along t cubed.

    std/math/easing.fb, line 53

    EaseInQuart function

    Public Function EaseInQuart(t: Float): Float

    t to the fourth.

    std/math/easing.fb, line 56

    EaseOutQuart function

    Public Function EaseOutQuart(t: Float): Float

    Out along t to the fourth.

    std/math/easing.fb, line 58

    EaseInOutQuart function

    Public Function EaseInOutQuart(t: Float): Float

    In and out along t to the fourth.

    std/math/easing.fb, line 60

    EaseInQuint function

    Public Function EaseInQuint(t: Float): Float

    t to the fifth.

    std/math/easing.fb, line 63

    EaseOutQuint function

    Public Function EaseOutQuint(t: Float): Float

    Out along t to the fifth.

    std/math/easing.fb, line 65

    EaseInOutQuint function

    Public Function EaseInOutQuint(t: Float): Float

    In and out along t to the fifth.

    std/math/easing.fb, line 67

    EaseInExpo function

    Public Function EaseInExpo(t: Float): Float

    2 to the power of 10 t, from 0 to 1 at the ends.

    std/math/easing.fb, line 70

    EaseOutExpo function

    Public Function EaseOutExpo(t: Float): Float

    Out along 2 to the power of 10 t, from 0 to 1 at the ends.

    std/math/easing.fb, line 72

    EaseInOutExpo function

    Public Function EaseInOutExpo(t: Float): Float

    In and out along 2 to the power of 10 t, from 0 to 1 at the ends.

    std/math/easing.fb, line 75

    EaseInCirc function

    Public Function EaseInCirc(t: Float): Float

    Along a quarter of a circle.

    std/math/easing.fb, line 82

    EaseOutCirc function

    Public Function EaseOutCirc(t: Float): Float

    Out along a quarter of a circle.

    std/math/easing.fb, line 84

    EaseInOutCirc function

    Public Function EaseInOutCirc(t: Float): Float

    In and out along a quarter of a circle.

    std/math/easing.fb, line 87

    EaseInBack function

    Public Function EaseInBack(t: Float): Float

    Pulling back below 0 before going, or past 1 before stopping.

    std/math/easing.fb, line 93

    EaseOutBack function

    Public Function EaseOutBack(t: Float): Float

    Out, past 1 before stopping.

    std/math/easing.fb, line 95

    EaseInOutBack function

    Public Function EaseInOutBack(t: Float): Float

    In and out, pulling back below 0 before going and past 1 before stopping.

    std/math/easing.fb, line 100

    EaseInElastic function

    Public Function EaseInElastic(t: Float): Float

    Springing past 0 or 1, as on an elastic, the swings shrinking.

    std/math/easing.fb, line 106

    EaseOutElastic function

    Public Function EaseOutElastic(t: Float): Float

    Out, springing past 1, as on an elastic, the swings shrinking.

    std/math/easing.fb, line 113

    EaseInOutElastic function

    Public Function EaseInOutElastic(t: Float): Float

    In and out, springing past 0 and 1, as on an elastic, the swings shrinking.

    std/math/easing.fb, line 120

    EaseInBounce function

    Public Function EaseInBounce(t: Float): Float

    Bouncing, as a ball dropped does, the bounces shrinking.

    std/math/easing.fb, line 129

    EaseOutBounce function

    Public Function EaseOutBounce(t: Float): Float

    Four bounces, each lower, the last ending at 1.

    std/math/easing.fb, line 132

    EaseInOutBounce function

    Public Function EaseInOutBounce(t: Float): Float

    In and out, bouncing, as a ball dropped does, the bounces shrinking.

    std/math/easing.fb, line 149

    Report an issue with this page or with FutureBlitz on GitHub.