lm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(value, min, max float64) float64

func FloorDiv

func FloorDiv(a, b int) int

floorDiv returns the result of floor division. The difference compared to usual division is that floor division always rounds down instead of rounding towards zero.

func Radians

func Radians(degrees float64) float64

Types

type Matrix3

type Matrix3 struct {
	// contains filtered or unexported fields
}

func DimetricProjection

func DimetricProjection() Matrix3

func NewMatrix3

func NewMatrix3(m [9]float64) Matrix3

func (*Matrix3) Mul

func (lhs *Matrix3) Mul(rhs *Matrix3) Matrix3

func (*Matrix3) MulVec

func (lhs *Matrix3) MulVec(rhs Vector3) Vector3

type Vector2

type Vector2 struct {
	X, Y float64
}

func Vec2

func Vec2(x, y float64) Vector2

func (Vector2) Add

func (lhs Vector2) Add(rhs Vector2) Vector2

func (Vector2) Max

func (lhs Vector2) Max(rhs Vector2) Vector2

func (Vector2) Min

func (lhs Vector2) Min(rhs Vector2) Vector2

func (Vector2) Mul

func (lhs Vector2) Mul(rhs Vector2) Vector2

func (Vector2) MulScalar

func (lhs Vector2) MulScalar(rhs float64) Vector2

func (Vector2) Sub

func (lhs Vector2) Sub(rhs Vector2) Vector2

type Vector3

type Vector3 struct {
	X, Y, Z float64
}

func Vec3

func Vec3(x, y, z float64) Vector3

func (Vector3) Add

func (lhs Vector3) Add(rhs Vector3) Vector3

func (Vector3) ClampScalar

func (lhs Vector3) ClampScalar(min, max float64) Vector3

func (Vector3) Cross

func (lhs Vector3) Cross(rhs Vector3) Vector3

func (Vector3) DivScalar

func (lhs Vector3) DivScalar(rhs float64) Vector3

func (Vector3) Dot

func (lhs Vector3) Dot(rhs Vector3) float64

func (Vector3) Length

func (lhs Vector3) Length() float64

func (Vector3) MaxComponent

func (lhs Vector3) MaxComponent() float64

func (Vector3) MulScalar

func (lhs Vector3) MulScalar(rhs float64) Vector3

func (Vector3) Normalize

func (lhs Vector3) Normalize() Vector3

func (Vector3) PowScalar

func (lhs Vector3) PowScalar(power float64) Vector3

func (Vector3) RotateXY

func (lhs Vector3) RotateXY(angle float64) Vector3

func (Vector3) RotateXZ

func (lhs Vector3) RotateXZ(angle float64) Vector3

func (Vector3) RotateYZ

func (lhs Vector3) RotateYZ(angle float64) Vector3

func (Vector3) XY

func (lhs Vector3) XY() Vector2

type Vector4

type Vector4 struct {
	X, Y, Z, W float64
}

func Vec4

func Vec4(x, y, z, w float64) Vector4

func (Vector4) ClampScalar

func (lhs Vector4) ClampScalar(min, max float64) Vector4

func (Vector4) MulScalar

func (lhs Vector4) MulScalar(rhs float64) Vector4

func (Vector4) XYZ

func (lhs Vector4) XYZ() Vector3

Jump to

Keyboard shortcuts

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