Documentation
¶
Index ¶
- Constants
- func Clamp(value, min, max float64) float64
- func Degrees(radians float64) float64
- func Fract(x float64) float64
- func Lerp(start, end, t float64) float64
- func LinSpace(min, max float64, n int) []float64
- func MapRange(v, a, b, c, d float64) float64
- func OppositeAngle(angle float64) float64
- func Radians(degrees float64) float64
- func SinSpace(amplitude float64, n int) []float64
Constants ¶
View Source
const ( // Tau (τ) is two times pi , representing a full circle in radians. https://oeis.org/A019692 Tau = 6.2831853071795864769252867665590057683943387987502 // Phi (φ) is golden ratio. https://oeis.org/A001622/constant Phi = 1.6180339887498948482045868343656381177203091798058 // Golden angle in radians (4-2*Phi)*Pi https://oeis.org/A131988/constant GoldenAngle = 2.3999632297286533222315555066336138531249990110581 )
Variables ¶
This section is empty.
Functions ¶
func Lerp ¶
Lerp performs linear interpolation between start and end based on t. t should be in the range [0, 1] where 0 returns start and 1 returns end. If t is outside this range, it will extrapolate.
func LinSpace ¶
LinSpace returns a slice of float64 values spaced evenly between min and max.
If n is less than or equal to 1, it returns a slice with only the min value.
func OppositeAngle ¶
OppositeAngle returns opposite angle. Unit is radians. It adds π to the angle and wraps it around if it exceeds 2π.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.