Documentation
¶
Index ¶
- func Clamp[T cmp.Ordered](low, high, value T) T
- func Degree(rad float64) float64
- func DifferenceDegrees(a float64, b float64) float64
- func Lerp(start float64, stop float64, amount float64) float64
- func NormalizeDegree(angle float64) float64
- func NormalizeDegreeInt(angle int) int
- func NormalizeRadian(angle float64) float64
- func Radian(deg float64) float64
- func RotationDirection(from float64, to float64) float64
- func Sign[T Signed](n T) T
- func SignCmp[T cmp.Ordered](a, b T) int
- type Matrix3
- type Signed
- type Vector3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶
Clamp takes in a value and two thresholds. If the value is smaller than the low threshold, it returns the low threshold. If it's bigger than the high threshold it returns the high threshold. Otherwise it returns the value.
func DifferenceDegrees ¶
DifferenceDegrees of two points on a circle, represented using degrees.
func NormalizeDegree ¶
NormalizeDegree takes an angle in degrees and normalizes it to the range 0-360
func NormalizeDegreeInt ¶
NormalizeDegree takes an angle in degrees and normalizes it to the range 0-360
func NormalizeRadian ¶
NormalizeDegree takes an angle in degrees and normalizes it to the range 0-360
func RotationDirection ¶
Types ¶
type Matrix3 ¶
type Matrix3 [3]Vector3
Matrix3 defines a 3x3 matrix of float64 values
func NewMatrix3 ¶
func (Matrix3) Multiply ¶
Multiply applies the matrix to a 3D vector and returns the resulting vector
func (Matrix3) MultiplyXYZ ¶
MultiplyXYZ takes x, y, z and creates 3D Vector3. Then Multiply m with the newly created Vector3. Returns the resulting vector
type Vector3 ¶
type Vector3 [3]float64
Vector3 defines a 3D vector