math32

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pi      = float32(math.Pi)
	TwoPi   = float32(2. * Pi)
	Epsilon = math.SmallestNonzeroFloat32
)

Variables

This section is empty.

Functions

func Abs

func Abs(x float32) float32

func AngleDiff

func AngleDiff(from, to float32) float32

func Atan2

func Atan2(y, x float32) float32

func Clamp

func Clamp(x, min, max float32) float32

func Cos

func Cos(x float32) float32

func DegreesFromRadians

func DegreesFromRadians(radians float32) float32

func Floor

func Floor(x float32) float32

func Lerp

func Lerp(a, b, f float32) float32

func MagnitudeAndSign

func MagnitudeAndSign(x float32) (float32, float32)

func Max

func Max(x, y float32) float32

func Min

func Min(x, y float32) float32

func Mod

func Mod(x, y float32) float32

func Modf

func Modf(x float32) (float32, float32)

func NaN

func NaN() float32

func NormalizeAngle

func NormalizeAngle(a float32) float32

NormalizeAngle normalizes an angle and ensures it lies in the range [-Pi,+Pi]

func Pow

func Pow(x, y float32) float32

func RadiansFromDegrees

func RadiansFromDegrees(degrees float32) float32

func Sin

func Sin(x float32) float32

func SinCos

func SinCos(x float32) (float32, float32)

func Sqrt

func Sqrt(x float32) float32

Types

type NormallyDistributedValue

type NormallyDistributedValue struct {
	Mean, StdDev float32
}

func (NormallyDistributedValue) Get

type UniformRangedValue

type UniformRangedValue struct {
	Min, Max float32
}

func (UniformRangedValue) Get

func (v UniformRangedValue) Get(r *rand.Rand) float32

Jump to

Keyboard shortcuts

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