vmath

package
v0.0.0-...-84ef37a Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RectsIntersect

func RectsIntersect(min0, max0, min1, max1 *Vec2f) bool

func VecCross

func VecCross(v0, v1 *Vec2f) float64

Returns magnitude of 3d cross product between two vectors (treated as on the XY plane)

func VecDot

func VecDot(v0, v1 *Vec2f) float64

Types

type Vec2f

type Vec2f struct {
	X, Y float64
}

func NewVec

func NewVec(x, y float64) *Vec2f

func RandomDirection

func RandomDirection() *Vec2f

func VecFromAngle

func VecFromAngle(angle, magnitude float64) *Vec2f

func VecMax

func VecMax(v0, v1 *Vec2f) *Vec2f

func VecMin

func VecMin(v0, v1 *Vec2f) *Vec2f

func ZeroVec

func ZeroVec() *Vec2f

func (*Vec2f) Add

func (vec *Vec2f) Add(other *Vec2f) *Vec2f

func (*Vec2f) AddScalar

func (vec *Vec2f) AddScalar(scalar float64) *Vec2f

func (*Vec2f) Ceil

func (vec *Vec2f) Ceil() *Vec2f

func (*Vec2f) Clone

func (vec *Vec2f) Clone() *Vec2f

func (*Vec2f) Equals

func (vec *Vec2f) Equals(other *Vec2f) bool

func (*Vec2f) Floor

func (vec *Vec2f) Floor() *Vec2f

func (*Vec2f) Length

func (vec *Vec2f) Length() float64

func (*Vec2f) Lerp

func (vec *Vec2f) Lerp(other *Vec2f, t float64) *Vec2f

func (*Vec2f) Normalize

func (vec *Vec2f) Normalize() *Vec2f

func (*Vec2f) Scale

func (vec *Vec2f) Scale(s float64) *Vec2f

func (*Vec2f) Sub

func (vec *Vec2f) Sub(other *Vec2f) *Vec2f

func (*Vec2f) SubScalar

func (vec *Vec2f) SubScalar(scalar float64) *Vec2f

Jump to

Keyboard shortcuts

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