Documentation
¶
Overview ¶
Package easing contains easing functions
Index ¶
- Constants
- func BackIn(t, b, c, d float64) float64
- func BackInOut(t, b, c, d float64) float64
- func BackOut(t, b, c, d float64) float64
- func BounceIn(t, b, c, d float64) float64
- func BounceInOut(t, b, c, d float64) float64
- func BounceOut(t, b, c, d float64) float64
- func CircIn(t, b, c, d float64) float64
- func CircInOut(t, b, c, d float64) float64
- func CircOut(t, b, c, d float64) float64
- func CubicIn(t, b, c, d float64) float64
- func CubicInOut(t, b, c, d float64) float64
- func CubicOut(t, b, c, d float64) float64
- func ElasticIn(t, b, c, d float64) float64
- func ElasticInOut(t, b, c, d float64) float64
- func ElasticOut(t, b, c, d float64) float64
- func ExpoIn(t, b, c, d float64) float64
- func ExpoInOut(t, b, c, d float64) float64
- func ExpoOut(t, b, c, d float64) float64
- func Linear(t, b, c, d float64) float64
- func QuadIn(t, b, c, d float64) float64
- func QuadInOut(t, b, c, d float64) float64
- func QuadOut(t, b, c, d float64) float64
- func QuintIn(t, b, c, d float64) float64
- func QuintInOut(t, b, c, d float64) float64
- func QuintOut(t, b, c, d float64) float64
- func SineIn(t, b, c, d float64) float64
- func SineInOut(t, b, c, d float64) float64
- func SineOut(t, b, c, d float64) float64
- type Easing
Examples ¶
Constants ¶
const DoublePi = math.Pi * 2
DoublePi is 2 * Pi
Variables ¶
This section is empty.
Functions ¶
func BackIn ¶
BackIn Accelerating from zero velocity https://easings.net/#easeInBack
Example ¶
fmt.Println(BackIn(5, 0, 10, 10))
Output: -0.9655673136318949
func BackInOut ¶
BackInOut Acceleration until halfway, then deceleration https://easings.net/#easeInOutBack
Example ¶
fmt.Println(BackInOut(5, 0, 10, 10))
Output: 5
func BackOut ¶
BackOut Decelerating to zero velocity https://easings.net/#easeOutBack
Example ¶
fmt.Println(BackOut(5, 0, 10, 10))
Output: 10.965567313631894
func BounceIn ¶
BounceIn accelerating from zero velocity https://easings.net/#easeInBounce
Example ¶
fmt.Println(BounceIn(5, 0, 10, 10))
Output: 2.34375
func BounceInOut ¶
BounceInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutBounce
Example ¶
fmt.Println(BounceInOut(5, 0, 10, 10))
Output: 5
func BounceOut ¶
BounceOut Decelerating to zero velocity https://easings.net/#easeOutBounce
Example ¶
fmt.Println(BounceOut(5, 0, 10, 10))
Output: 7.65625
func CircIn ¶
CircIn accelerating from zero velocity https://easings.net/#easeInCirc
Example ¶
fmt.Println(CircIn(5, 0, 10, 10))
Output: 1.339745962155614
func CircInOut ¶
CircInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutCirc
Example ¶
fmt.Println(CircInOut(5, 0, 10, 10))
Output: 5
func CircOut ¶
CircOut decelerating to zero velocity https://easings.net/#easeOutCirc
Example ¶
fmt.Println(CircOut(5, 0, 10, 10))
Output: 8.660254037844386
func CubicIn ¶
CubicIn accelerating from zero velocity https://easings.net/#easeInCubic
Example ¶
fmt.Println(CubicIn(5, 0, 10, 10))
Output: 1.25
func CubicInOut ¶
CubicInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutCubic
Example ¶
fmt.Println(CubicInOut(5, 0, 10, 10))
Output: 5
func CubicOut ¶
CubicOut decelerating to zero velocity https://easings.net/#easeOutCubic
Example ¶
fmt.Println(CubicOut(5, 0, 10, 10))
Output: 8.75
func ElasticIn ¶
ElasticIn accelerating from zero velocity https://easings.net/#easeInElastic
Example ¶
fmt.Println(ElasticIn(5, 0, 10, 10))
Output: -0.15625000000000044
func ElasticInOut ¶
ElasticInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutElastic
Example ¶
fmt.Println(ElasticInOut(5, 0, 10, 10))
Output: 5
func ElasticOut ¶
ElasticOut decelerating to zero velocity https://easings.net/#easeOutElastic
Example ¶
fmt.Println(ElasticOut(5, 0, 10, 10))
Output: 10.15625
func ExpoIn ¶
ExpoIn accelerating from zero velocity https://easings.net/#easeInExpo
Example ¶
fmt.Println(ExpoIn(5, 0, 10, 10))
Output: 0.3125
func ExpoInOut ¶
ExpoInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutExpo
Example ¶
fmt.Println(ExpoInOut(5, 0, 10, 10))
Output: 5
func ExpoOut ¶
ExpoOut decelerating to zero velocity https://easings.net/#easeOutExpo
Example ¶
fmt.Println(ExpoOut(5, 0, 10, 10))
Output: 9.6875
func Linear ¶
Linear no easing and no acceleration
Example ¶
fmt.Println(Linear(5, 0, 10, 10))
Output: 5
func QuadIn ¶
QuadIn accelerating from zero velocity https://easings.net/#easeInQuad
Example ¶
fmt.Println(QuadIn(5, 0, 10, 10))
Output: 2.5
func QuadInOut ¶
QuadInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutQuad
Example ¶
fmt.Println(QuadInOut(5, 0, 10, 10))
Output: 5
func QuadOut ¶
QuadOut decelerating to zero velocity https://easings.net/#easeOutQuad
Example ¶
fmt.Println(QuadOut(5, 0, 10, 10))
Output: 7.5
func QuintIn ¶
QuintIn accelerating from zero velocity https://easings.net/#easeInQuint
Example ¶
fmt.Println(QuintIn(5, 0, 10, 10))
Output: 0.3125
func QuintInOut ¶
QuintInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutQuint
Example ¶
fmt.Println(QuintInOut(5, 0, 10, 10))
Output: 5
func QuintOut ¶
QuintOut decelerating to zero velocity https://easings.net/#easeOutQuint
Example ¶
fmt.Println(QuintOut(5, 0, 10, 10))
Output: 9.6875
func SineIn ¶
SineIn accelerating from zero velocity https://easings.net/#easeInSine
Example ¶
fmt.Println(SineIn(5, 0, 10, 10))
Output: 3.0978992192751917
func SineInOut ¶
SineInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutSine
Example ¶
fmt.Println(SineInOut(5, 0, 10, 10))
Output: 4.999999999999999