math

package
v0.0.0-...-d4fbba4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EaseIn

func EaseIn(progress float64) float64

EaseIn is an easing function that slows progress at the start.

func EaseInOut

func EaseInOut(progress float64) float64

EaseInOut is an easing function that slows progress at the start and end.

func EaseOut

func EaseOut(progress float64) float64

EaseOut is an easing function that slows progress at the end.

func EaseOutBounce

func EaseOutBounce(progress float64) float64

EaseOutBounce is an easing function that rapidly approaches the end and then bounces back, gradually settling in to place. Using the algorithm described at https://easings.net/#easeOutBounce.

func Lerp

func Lerp(v1, v2 float64, progress float64) float64

Lerp performs a linear interpolation between two values, given the progress between them in the range [0,1].

func Lerp2D

func Lerp2D(x1, y1 float64, x2, y2 float64, progress float64) (x, y float64)

Lerp2D performs linear interpolation on both X and Y co-ordinates, given the progress between them in the range [0,1].

func LerpPoint

func LerpPoint(p1, p2 image.Point, progress float64) image.Point

LerpPoint performs linear interpolation on both the X and Y coordinates of the given points. The resulting value is rounded to the nearest int.

Types

This section is empty.

Jump to

Keyboard shortcuts

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