21 lines
342 B
Go
21 lines
342 B
Go
package main
|
|
|
|
import (
|
|
"math"
|
|
)
|
|
|
|
func easeInOutCubic(x float32) float32 {
|
|
if x < 0.5 {
|
|
return 4 * x * x * x
|
|
} else {
|
|
return 1 - float32(math.Pow(float64(-2*x+2), 3))/2
|
|
}
|
|
}
|
|
|
|
func lerp(v0, v1, t float32) float32 {
|
|
return (1-t)*v0 + t*v1
|
|
}
|
|
|
|
func easeInOutSine(x float32) float32 {
|
|
return -float32(math.Cos(math.Pi*float64(x))-1) / 2
|
|
}
|