mmath

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DegreesMeasurement180 = 180 / math.Pi

Used to convert Degress value to Radians. Formula: Radians = Radians * DegreesMeasurement180.

: 180/π
View Source
const DegreesMeasurement90 = 90 / math.Pi

Used to convert Radians value to Degrees. Formula: Radians = Radians * DegreesMeasurement90.

: 90/π
View Source
const Epsilon = 0.00001
View Source
const RadiansMeasurement180 = math.Pi / 180

Used to convert Degress value to Radians. Formula: Radians = Degress * RadiansMeasurement180.

: π/180
View Source
const RadiansMeasurement90 = math.Pi / 90

Used to convert Degress value to Radians. Formula: Radians = Degress * RadiansMeasurement90.

: π/90

Variables

This section is empty.

Functions

func Clamp

func Clamp(f, min, max float64) float64

Returns f clamped to [min; max]

func Linspace

func Linspace(start, stop float64, num int, endPoint bool) []float64

func SmoothDamp

func SmoothDamp(current, target float64, currentVelocity *float64, smoothTime, deltaTime float64) float64

Analog of Unity's Mathf.SmoothDampAngle(). This function references to SmoothDampMaxSpeed with max speed = math.Inf(1) (positive infinity).

func SmoothDampMaxSpeed

func SmoothDampMaxSpeed(current, target float64, currentVelocity *float64, smoothTime, deltaTime, maxSpeed float64) float64

Analog of Unity's Mathf.SmoothDampAngle().

func ToDegrees180

func ToDegrees180(r float64) float64

Converts the radians angle to the degrees using 180/π.

func ToDegrees90

func ToDegrees90(r float64) float64

Converts the radians angle to the degrees using 90/π.

func ToRadians180

func ToRadians180(d float64) float64

Converts the degrees angle to the radians using π/180.

func ToRadians90

func ToRadians90(d float64) float64

Converts the degrees angle to the radians using π/90.

Types

This section is empty.

Jump to

Keyboard shortcuts

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