EaseFunction
public enum EaseFunction
An easing function that determines the path used to get from point A to point B by calculating the position given a specific point in time.
These easing functions are based upon Robert Penner’s Easing Functions. A visualized cheat-sheet of these functions can be found at easings.net.
The aspect of time is crucial to motion — things change over time. Nothing can move in “zero time”, or be in two places at once. In other words, a position needs time to change, and it can have only one value at a specific point in time.
Because position and time have this one-to-one relationship, we can say that position is a function of time. This means that, given a specific point in time, we can find one, and only one, corresponding position.
-
Calculates the
y
value for coordinatex
using linear easing.Declaration
Swift
public static func linear(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using sinusoidal-in easing.Declaration
Swift
public static func sineIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using sinusoidal-out easing.Declaration
Swift
public static func sineOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using sinusoidal-in-out easing.Declaration
Swift
public static func sineInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using cubic-in easing.Declaration
Swift
public static func cubicIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using cubic-out easing.Declaration
Swift
public static func cubicOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using cubic-in-out easing.Declaration
Swift
public static func cubicInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using quadratic-in easing.Declaration
Swift
public static func quadIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quadratic-out easing.Declaration
Swift
public static func quadOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quadratic-in-out easing.Declaration
Swift
public static func quadInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using quartic-in easing.Declaration
Swift
public static func quartIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quartic-out easing.Declaration
Swift
public static func quartOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quartic-in-out easing.Declaration
Swift
public static func quartInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using quintic-in easing.Declaration
Swift
public static func quintIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quintic-out easing.Declaration
Swift
public static func quintOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using quintic-in-out easing.Declaration
Swift
public static func quintInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using exponential-in easing.Declaration
Swift
public static func expoIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using exponential-out easing.Declaration
Swift
public static func expoOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using exponential-in-out easing.Declaration
Swift
public static func expoInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using circular-in easing.Declaration
Swift
public static func circIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using circular-out easing.Declaration
Swift
public static func circOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using circular-in-out easing.Declaration
Swift
public static func circInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using back-in easing.Declaration
Swift
public static func backIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using back-out easing.Declaration
Swift
public static func backOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using back-in-out easing.Declaration
Swift
public static func backInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using elastic-in easing.Declaration
Swift
public static func elasticIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using elastic-out easing.Declaration
Swift
public static func elasticOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using elastic-in-out easing.Declaration
Swift
public static func elasticInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].
-
Calculates the
y
value for coordinatex
using bounce-in easing.Declaration
Swift
public static func bounceIn(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using bounce-out easing.Declaration
Swift
public static func bounceOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1]. -
Calculates the
y
value for coordinatex
using bounce-in-out easing.Declaration
Swift
public static func bounceInOut(_ x: Double) -> Double
Parameters
x
The
x
coordinate to which they
value is returned, between [0, 1].Return Value
The
y
value for coordinatex
, between [0, 1].