easing

package
v12.41.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package easing contains easing functions

Index

Examples

Constants

View Source
const DoublePi = math.Pi * 2

DoublePi is 2 * Pi

Variables

This section is empty.

Functions

func BackIn

func BackIn(t, b, c, d float64) float64

BackIn Accelerating from zero velocity https://easings.net/#easeInBack

Example
fmt.Println(BackIn(5, 0, 10, 10))
Output:

-0.9655673136318949

func BackInOut

func BackInOut(t, b, c, d float64) float64

BackInOut Acceleration until halfway, then deceleration https://easings.net/#easeInOutBack

Example
fmt.Println(BackInOut(5, 0, 10, 10))
Output:

5

func BackOut

func BackOut(t, b, c, d float64) float64

BackOut Decelerating to zero velocity https://easings.net/#easeOutBack

Example
fmt.Println(BackOut(5, 0, 10, 10))
Output:

10.965567313631894

func BounceIn

func BounceIn(t, b, c, d float64) float64

BounceIn accelerating from zero velocity https://easings.net/#easeInBounce

Example
fmt.Println(BounceIn(5, 0, 10, 10))
Output:

2.34375

func BounceInOut

func BounceInOut(t, b, c, d float64) float64

BounceInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutBounce

Example
fmt.Println(BounceInOut(5, 0, 10, 10))
Output:

5

func BounceOut

func BounceOut(t, b, c, d float64) float64

BounceOut Decelerating to zero velocity https://easings.net/#easeOutBounce

Example
fmt.Println(BounceOut(5, 0, 10, 10))
Output:

7.65625

func CircIn

func CircIn(t, b, c, d float64) float64

CircIn accelerating from zero velocity https://easings.net/#easeInCirc

Example
fmt.Println(CircIn(5, 0, 10, 10))
Output:

1.339745962155614

func CircInOut

func CircInOut(t, b, c, d float64) float64

CircInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutCirc

Example
fmt.Println(CircInOut(5, 0, 10, 10))
Output:

5

func CircOut

func CircOut(t, b, c, d float64) float64

CircOut decelerating to zero velocity https://easings.net/#easeOutCirc

Example
fmt.Println(CircOut(5, 0, 10, 10))
Output:

8.660254037844386

func CubicIn

func CubicIn(t, b, c, d float64) float64

CubicIn accelerating from zero velocity https://easings.net/#easeInCubic

Example
fmt.Println(CubicIn(5, 0, 10, 10))
Output:

1.25

func CubicInOut

func CubicInOut(t, b, c, d float64) float64

CubicInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutCubic

Example
fmt.Println(CubicInOut(5, 0, 10, 10))
Output:

5

func CubicOut

func CubicOut(t, b, c, d float64) float64

CubicOut decelerating to zero velocity https://easings.net/#easeOutCubic

Example
fmt.Println(CubicOut(5, 0, 10, 10))
Output:

8.75

func ElasticIn

func ElasticIn(t, b, c, d float64) float64

ElasticIn accelerating from zero velocity https://easings.net/#easeInElastic

Example
fmt.Println(ElasticIn(5, 0, 10, 10))
Output:

-0.15625000000000044

func ElasticInOut

func ElasticInOut(t, b, c, d float64) float64

ElasticInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutElastic

Example
fmt.Println(ElasticInOut(5, 0, 10, 10))
Output:

5

func ElasticOut

func ElasticOut(t, b, c, d float64) float64

ElasticOut decelerating to zero velocity https://easings.net/#easeOutElastic

Example
fmt.Println(ElasticOut(5, 0, 10, 10))
Output:

10.15625

func ExpoIn

func ExpoIn(t, b, c, d float64) float64

ExpoIn accelerating from zero velocity https://easings.net/#easeInExpo

Example
fmt.Println(ExpoIn(5, 0, 10, 10))
Output:

0.3125

func ExpoInOut

func ExpoInOut(t, b, c, d float64) float64

ExpoInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutExpo

Example
fmt.Println(ExpoInOut(5, 0, 10, 10))
Output:

5

func ExpoOut

func ExpoOut(t, b, c, d float64) float64

ExpoOut decelerating to zero velocity https://easings.net/#easeOutExpo

Example
fmt.Println(ExpoOut(5, 0, 10, 10))
Output:

9.6875

func Linear

func Linear(t, b, c, d float64) float64

Linear no easing and no acceleration

Example
fmt.Println(Linear(5, 0, 10, 10))
Output:

5

func QuadIn

func QuadIn(t, b, c, d float64) float64

QuadIn accelerating from zero velocity https://easings.net/#easeInQuad

Example
fmt.Println(QuadIn(5, 0, 10, 10))
Output:

2.5

func QuadInOut

func QuadInOut(t, b, c, d float64) float64

QuadInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutQuad

Example
fmt.Println(QuadInOut(5, 0, 10, 10))
Output:

5

func QuadOut

func QuadOut(t, b, c, d float64) float64

QuadOut decelerating to zero velocity https://easings.net/#easeOutQuad

Example
fmt.Println(QuadOut(5, 0, 10, 10))
Output:

7.5

func QuintIn

func QuintIn(t, b, c, d float64) float64

QuintIn accelerating from zero velocity https://easings.net/#easeInQuint

Example
fmt.Println(QuintIn(5, 0, 10, 10))
Output:

0.3125

func QuintInOut

func QuintInOut(t, b, c, d float64) float64

QuintInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutQuint

Example
fmt.Println(QuintInOut(5, 0, 10, 10))
Output:

5

func QuintOut

func QuintOut(t, b, c, d float64) float64

QuintOut decelerating to zero velocity https://easings.net/#easeOutQuint

Example
fmt.Println(QuintOut(5, 0, 10, 10))
Output:

9.6875

func SineIn

func SineIn(t, b, c, d float64) float64

SineIn accelerating from zero velocity https://easings.net/#easeInSine

Example
fmt.Println(SineIn(5, 0, 10, 10))
Output:

3.0978992192751917

func SineInOut

func SineInOut(t, b, c, d float64) float64

SineInOut acceleration until halfway, then deceleration https://easings.net/#easeInOutSine

Example
fmt.Println(SineInOut(5, 0, 10, 10))
Output:

4.999999999999999

func SineOut

func SineOut(t, b, c, d float64) float64

SineOut decelerating to zero velocity https://easings.net/#easeOutSine

Example
fmt.Println(SineOut(5, 0, 10, 10))
Output:

7.236090437019012

Types

type Easing

type Easing func(t, b, c, d float64) float64

Easing is type for any easing function t - current time b - start value c - changes in value d - duration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL