The easing class implements the functions of the predefined IEnums::Interpolation curves. More...
#include "murl_math_easing.h"
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
using | Interpolate = DataType(*)(DataType x) |
Definition of the easing function type. | |
Static Public Member Functions | |
static DataType | Constant (DataType x) |
Constant interpolation. More... | |
static DataType | Linear (DataType x) |
Linear interpolation. More... | |
static DataType | SmoothstepInOut (DataType x) |
Smoothstep "in-out" interpolation. More... | |
static DataType | SmoothstepIn (DataType x) |
Smoothstep "in" interpolation. More... | |
static DataType | SmoothstepOut (DataType x) |
Smoothstep "out" interpolation. More... | |
static DataType | SmoothstepOutIn (DataType x) |
Smoothstep "out-in" interpolation. More... | |
static DataType | SmootherstepInOut (DataType x) |
Smootherstep "in-out" interpolation. More... | |
static DataType | SmootherstepIn (DataType x) |
Smootherstep "in" interpolation. More... | |
static DataType | SmootherstepOut (DataType x) |
Smootherstep "out" interpolation. More... | |
static DataType | SmootherstepOutIn (DataType x) |
Smootherstep "out-in" interpolation. More... | |
static DataType | EaseIn (DataType x) |
Ease (cubic) "in" interpolation. More... | |
static DataType | EaseOut (DataType x) |
Ease (cubic) "out" interpolation. More... | |
static DataType | EaseInOut (DataType x) |
Ease (cubic) "in-out" interpolation. More... | |
static DataType | EaseOutIn (DataType x) |
Ease (cubic) "out-in" interpolation. More... | |
static DataType | EaseQuartIn (DataType x) |
Ease Quart "in" interpolation. More... | |
static DataType | EaseQuartOut (DataType x) |
Ease Quart "out" interpolation. More... | |
static DataType | EaseQuartInOut (DataType x) |
Ease Quart "in-out" interpolation. More... | |
static DataType | EaseQuartOutIn (DataType x) |
Ease Quart "out-in" interpolation. More... | |
static DataType | EaseExponentialIn (DataType x) |
Ease Exponential "in" interpolation. More... | |
static DataType | EaseExponentialOut (DataType x) |
Ease Exponential "out" interpolation. More... | |
static DataType | EaseExponentialInOut (DataType x) |
Ease Exponential "in-out" interpolation. More... | |
static DataType | EaseExponentialOutIn (DataType x) |
Ease Exponential "out-in" interpolation. More... | |
static DataType | EaseCircularIn (DataType x) |
Ease Circular "in" interpolation. More... | |
static DataType | EaseCircularOut (DataType x) |
Ease Circular "out" interpolation. More... | |
static DataType | EaseCircularHelper (DataType x) |
Ease Circular helper interpolation. More... | |
static DataType | EaseCircularInOut (DataType x) |
Ease Circular "in-out" interpolation. More... | |
static DataType | EaseCircularOutIn (DataType x) |
Ease Circular "out-in" interpolation. More... | |
static DataType | EaseBackIn (DataType x) |
Ease Back "in" interpolation. More... | |
static DataType | EaseBackOut (DataType x) |
Ease Back "out" interpolation. More... | |
static DataType | EaseBackInOut (DataType x) |
Ease Back "in-out" interpolation. More... | |
static DataType | EaseBackOutIn (DataType x) |
Ease Back "out-in" interpolation. More... | |
static DataType | EaseElasticIn (DataType x) |
Ease Elastic "in" interpolation. More... | |
static DataType | EaseElasticOut (DataType x) |
Ease Elastic "out" interpolation. More... | |
static DataType | EaseElasticInOut (DataType x) |
Ease Elastic "in-out" interpolation. More... | |
static DataType | EaseElasticOutIn (DataType x) |
Ease Elastic "out-in" interpolation. More... | |
static DataType | EaseBounceOut (DataType x) |
Ease Bounce "out" interpolation. More... | |
static DataType | EaseBounceIn (DataType x) |
Ease Bounce "in" interpolation. More... | |
static DataType | EaseBounceInOut (DataType x) |
Ease Bounce "in-out" interpolation. More... | |
static DataType | EaseBounceOutIn (DataType x) |
Ease Bounce "in-out" interpolation. More... | |
Detailed Description
template<class DataType>
class Murl::Math::Easing< DataType >
The easing class implements the functions of the predefined IEnums::Interpolation curves.
Smoothstep functions description can be found at http://wikipedia.org/wiki/Smoothstep
Easing functions description can be found at http://easings.net
Member Function Documentation
◆ Constant()
|
inlinestatic |
Constant interpolation.
Function: f(x)=0
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
◆ Linear()
|
inlinestatic |
Linear interpolation.
Function: f(x)=x
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
◆ SmoothstepInOut()
|
inlinestatic |
Smoothstep "in-out" interpolation.
Function: f(x)=(x^2)*(3-2*x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
Referenced by Murl::Math::Easing< DataType >::SmoothstepIn(), Murl::Math::Easing< DataType >::SmoothstepOut(), and Murl::Math::Easing< DataType >::SmoothstepOutIn().
◆ SmoothstepIn()
|
inlinestatic |
Smoothstep "in" interpolation.
Function: f(x)=SmoothstepInOut(x/2)*2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmoothstepInOut().
◆ SmoothstepOut()
|
inlinestatic |
Smoothstep "out" interpolation.
Function: f(x)=SmoothstepInOut((x+1)/2)*2-1
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmoothstepInOut().
◆ SmoothstepOutIn()
|
inlinestatic |
Smoothstep "out-in" interpolation.
Function: f(x)=(x < 0.5) ? SmoothstepInOut(x+0.5)-0.5 : SmoothstepInOut(x-0.5)+0.5
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmoothstepInOut().
◆ SmootherstepInOut()
|
inlinestatic |
Smootherstep "in-out" interpolation.
Function: f(x)=(x^3)*(x*(6*x-15)+10)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
Referenced by Murl::Math::Easing< DataType >::SmootherstepIn(), Murl::Math::Easing< DataType >::SmootherstepOut(), and Murl::Math::Easing< DataType >::SmootherstepOutIn().
◆ SmootherstepIn()
|
inlinestatic |
Smootherstep "in" interpolation.
Function: f(x)=SmootherstepInOut(x/2)*2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmootherstepInOut().
◆ SmootherstepOut()
|
inlinestatic |
Smootherstep "out" interpolation.
Function: f(x)=SmootherstepInOut((x+1)/2)*2-1
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmootherstepInOut().
◆ SmootherstepOutIn()
|
inlinestatic |
Smootherstep "out-in" interpolation.
Function: f(x)=(x < 0.5) ? SmootherstepInOut(x+0.5)-0.5 : SmootherstepInOut(x-0.5)+0.5
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::SmootherstepInOut().
◆ EaseIn()
|
inlinestatic |
Ease (cubic) "in" interpolation.
Function: f(x)=x^3
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
Referenced by Murl::Math::Easing< DataType >::EaseInOut(), Murl::Math::Easing< DataType >::EaseOut(), and Murl::Math::Easing< DataType >::EaseOutIn().
◆ EaseOut()
|
inlinestatic |
Ease (cubic) "out" interpolation.
Function: f(x)=1-EaseIn(1-x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseIn().
◆ EaseInOut()
|
inlinestatic |
Ease (cubic) "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseIn(2*x)/2 : 1-EaseIn(2-2*x)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseIn().
◆ EaseOutIn()
|
inlinestatic |
Ease (cubic) "out-in" interpolation.
Function: f(x)=4*EaseIn(x-0.5)+0.5
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseIn().
◆ EaseQuartIn()
|
inlinestatic |
Ease Quart "in" interpolation.
Function: f(x)=x^4
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
Referenced by Murl::Math::Easing< DataType >::EaseQuartInOut(), Murl::Math::Easing< DataType >::EaseQuartOut(), and Murl::Math::Easing< DataType >::EaseQuartOutIn().
◆ EaseQuartOut()
|
inlinestatic |
Ease Quart "out" interpolation.
Function: f(x)=1-EaseQuartIn(1-x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseQuartIn().
◆ EaseQuartInOut()
|
inlinestatic |
Ease Quart "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseQuartIn(2*x)/2 : 1-EaseQuartIn(2-2*x)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseQuartIn().
◆ EaseQuartOutIn()
|
inlinestatic |
Ease Quart "out-in" interpolation.
Function: f(x)=(x < 0.5) ? 0.5-EaseQuartIn(1-2*x)/2 : 0.5+EaseQuartIn(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseQuartIn().
◆ EaseExponentialIn()
|
inlinestatic |
Ease Exponential "in" interpolation.
Function: f(x)=(2^8x)*x/256
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Pow().
Referenced by Murl::Math::Easing< DataType >::EaseExponentialInOut(), Murl::Math::Easing< DataType >::EaseExponentialOut(), and Murl::Math::Easing< DataType >::EaseExponentialOutIn().
◆ EaseExponentialOut()
|
inlinestatic |
Ease Exponential "out" interpolation.
Function: f(x)=1-EaseExponentialIn(1-x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseExponentialIn().
◆ EaseExponentialInOut()
|
inlinestatic |
Ease Exponential "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseExponentialIn(2*x)/2 : 1-EaseExponentialIn(2-2*x)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseExponentialIn().
◆ EaseExponentialOutIn()
|
inlinestatic |
Ease Exponential "out-in" interpolation.
Function: f(x)=(x < 0.5) ? 0.5-EaseExponentialIn(1-2*x)/2 : 0.5+EaseExponentialIn(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseExponentialIn().
◆ EaseCircularIn()
|
inlinestatic |
Ease Circular "in" interpolation.
Function: f(x)=1-sqrt(1-x^2)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Sqrt().
◆ EaseCircularOut()
|
inlinestatic |
Ease Circular "out" interpolation.
Function: f(x)=sqrt((2-x)*x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Sqrt().
◆ EaseCircularHelper()
|
inlinestatic |
Ease Circular helper interpolation.
Function: f(x)=sqrt(x-x^2)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Sqrt().
Referenced by Murl::Math::Easing< DataType >::EaseCircularInOut(), and Murl::Math::Easing< DataType >::EaseCircularOutIn().
◆ EaseCircularInOut()
|
inlinestatic |
Ease Circular "in-out" interpolation.
Function: f(x)=(x < 0.5) ? 0.5-EaseCircularHelper(x+0.5) : 0.5+EaseCircularHelper(x-0.5)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseCircularHelper().
◆ EaseCircularOutIn()
|
inlinestatic |
Ease Circular "out-in" interpolation.
Function: f(x)=(x < 0.5) ? EaseCircularHelper(x) : 1-EaseCircularHelper(x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseCircularHelper().
◆ EaseBackIn()
|
inlinestatic |
Ease Back "in" interpolation.
Function: f(x)=(x^3)-x*sin(x*PI)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::PI, and Murl::Math::Sin().
Referenced by Murl::Math::Easing< DataType >::EaseBackInOut(), Murl::Math::Easing< DataType >::EaseBackOut(), and Murl::Math::Easing< DataType >::EaseBackOutIn().
◆ EaseBackOut()
|
inlinestatic |
Ease Back "out" interpolation.
Function: f(x)=1-EaseBackIn(1-x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBackIn().
◆ EaseBackInOut()
|
inlinestatic |
Ease Back "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseBackIn(2*x)/2 : 1-EaseBackIn(2-2*x)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBackIn().
◆ EaseBackOutIn()
|
inlinestatic |
Ease Back "out-in" interpolation.
Function: f(x)=(x < 0.5) ? 0.5-EaseBackIn(1-2*x)/2 : 0.5+EaseBackIn(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBackIn().
◆ EaseElasticIn()
|
inlinestatic |
Ease Elastic "in" interpolation.
Function: f(x)=sin(13*PI/2*x)*2^(10*(x-1))
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::HALF_PI, Murl::Math::Pow(), and Murl::Math::Sin().
Referenced by Murl::Math::Easing< DataType >::EaseElasticInOut(), Murl::Math::Easing< DataType >::EaseElasticOut(), and Murl::Math::Easing< DataType >::EaseElasticOutIn().
◆ EaseElasticOut()
|
inlinestatic |
Ease Elastic "out" interpolation.
Function: f(x)=1-EaseElasticIn(1-x)
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseElasticIn().
◆ EaseElasticInOut()
|
inlinestatic |
Ease Elastic "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseElasticIn(2*x)/2 : 1-EaseElasticIn(2-2*x)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseElasticIn().
◆ EaseElasticOutIn()
|
inlinestatic |
Ease Elastic "out-in" interpolation.
Function: f(x)=(x < 0.5) ? 0.5-EaseElasticIn(1-2*x)/2 : 0.5+EaseElasticIn(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseElasticIn().
◆ EaseBounceOut()
|
inlinestatic |
Ease Bounce "out" interpolation.
Function: f(x)= ... = a halve and three shrinking bounces
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
Referenced by Murl::Math::Easing< DataType >::EaseBounceIn(), Murl::Math::Easing< DataType >::EaseBounceInOut(), and Murl::Math::Easing< DataType >::EaseBounceOutIn().
◆ EaseBounceIn()
|
inlinestatic |
Ease Bounce "in" interpolation.
Function: f(x)=1-EaseBounceOut(1-x) = three and a halve growing bounces
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBounceOut().
Referenced by Murl::Math::Easing< DataType >::EaseBounceInOut(), and Murl::Math::Easing< DataType >::EaseBounceOutIn().
◆ EaseBounceInOut()
|
inlinestatic |
Ease Bounce "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseBounceIn(2*x)/2 : 0.5+EaseBounceOut(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBounceIn(), and Murl::Math::Easing< DataType >::EaseBounceOut().
◆ EaseBounceOutIn()
|
inlinestatic |
Ease Bounce "in-out" interpolation.
Function: f(x)=(x < 0.5) ? EaseBounceOut(2*x)/2 : 0.5+EaseBounceIn(2*x-1)/2
- Parameters
-
x The value to interpolate in range [0 .. 1].
- Returns
- The result for f(x).
References Murl::Math::Easing< DataType >::EaseBounceIn(), and Murl::Math::Easing< DataType >::EaseBounceOut().
The documentation for this class was generated from the following file:
- murl_math_easing.h