vector

package
v0.0.0-...-0518d83 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TopLeft      = Vector2d{-1, -1}
	Centre       = Vector2d{0, 0} //nolint:misspell
	CentreLeft   = Vector2d{-1, 0}
	TopRight     = Vector2d{1, -1}
	BottomCentre = Vector2d{0, 1}
	TopCentre    = Vector2d{0, -1}
	CentreRight  = Vector2d{1, 0}
	BottomLeft   = Vector2d{-1, 1}
	BottomRight  = Vector2d{1, 1}
)

DON'T TOUCH THIS

Functions

func AngleBetween32

func AngleBetween32(centre, p1, p2 Vector2f) float32

func AngleBetween64

func AngleBetween64(centre, p1, p2 Vector2d) float64

func IsStraightLine32

func IsStraightLine32(a, b, c Vector2f) bool

func IsStraightLine64

func IsStraightLine64(a, b, c Vector2d) bool

Types

type Vector2d

type Vector2d struct {
	X, Y float64
}

func NewVec2d

func NewVec2d(x, y float64) Vector2d

func NewVec2dRad

func NewVec2dRad(rad, length float64) Vector2d

func ParseOrigin

func ParseOrigin(v string) Vector2d

func (Vector2d) Abs

func (v Vector2d) Abs() Vector2d

func (Vector2d) Add

func (v Vector2d) Add(v1 Vector2d) Vector2d

func (Vector2d) AddS

func (v Vector2d) AddS(x, y float64) Vector2d

func (Vector2d) Angle

func (v Vector2d) Angle() float64

func (Vector2d) AngleR

func (v Vector2d) AngleR() float64

func (Vector2d) AngleRV

func (v Vector2d) AngleRV(v1 Vector2d) float64

func (Vector2d) AsVec3

func (v Vector2d) AsVec3() mgl32.Vec3

func (Vector2d) AsVec4

func (v Vector2d) AsVec4() mgl32.Vec4

func (Vector2d) Copy

func (v Vector2d) Copy() Vector2d

func (Vector2d) Copy32

func (v Vector2d) Copy32() Vector2f

func (Vector2d) Dot

func (v Vector2d) Dot(v1 Vector2d) float64

func (Vector2d) Dst

func (v Vector2d) Dst(v1 Vector2d) float64

func (Vector2d) DstSq

func (v Vector2d) DstSq(v1 Vector2d) float64

func (Vector2d) Len

func (v Vector2d) Len() float64

func (Vector2d) LenSq

func (v Vector2d) LenSq() float64

func (Vector2d) Lerp

func (v Vector2d) Lerp(v1 Vector2d, t float64) Vector2d

func (Vector2d) Mid

func (v Vector2d) Mid(v1 Vector2d) Vector2d

func (Vector2d) Mult

func (v Vector2d) Mult(v1 Vector2d) Vector2d

func (Vector2d) Nor

func (v Vector2d) Nor() Vector2d

func (Vector2d) Rotate

func (v Vector2d) Rotate(rad float64) Vector2d

func (Vector2d) Scl

func (v Vector2d) Scl(mag float64) Vector2d

func (Vector2d) String

func (v Vector2d) String() string

func (Vector2d) Sub

func (v Vector2d) Sub(v1 Vector2d) Vector2d

func (Vector2d) SubS

func (v Vector2d) SubS(x, y float64) Vector2d

func (Vector2d) X32

func (v Vector2d) X32() float32

func (Vector2d) Y32

func (v Vector2d) Y32() float32

type Vector2f

type Vector2f struct {
	X, Y float32
}

func NewVec2f

func NewVec2f(x, y float32) Vector2f

func NewVec2fRad

func NewVec2fRad(rad, length float32) Vector2f

func (Vector2f) Abs

func (v Vector2f) Abs() Vector2f

func (Vector2f) Add

func (v Vector2f) Add(v1 Vector2f) Vector2f

func (Vector2f) AddS

func (v Vector2f) AddS(x, y float32) Vector2f

func (Vector2f) Angle

func (v Vector2f) Angle() float32

func (Vector2f) AngleR

func (v Vector2f) AngleR() float32

func (Vector2f) AngleRV

func (v Vector2f) AngleRV(v1 Vector2f) float32

func (Vector2f) AsVec3

func (v Vector2f) AsVec3() mgl32.Vec3

func (Vector2f) AsVec4

func (v Vector2f) AsVec4() mgl32.Vec4

func (Vector2f) Copy

func (v Vector2f) Copy() Vector2f

func (Vector2f) Copy64

func (v Vector2f) Copy64() Vector2d

func (Vector2f) Dot

func (v Vector2f) Dot(v1 Vector2f) float32

func (Vector2f) Dst

func (v Vector2f) Dst(v1 Vector2f) float32

func (Vector2f) DstSq

func (v Vector2f) DstSq(v1 Vector2f) float32

func (Vector2f) Len

func (v Vector2f) Len() float32

func (Vector2f) LenSq

func (v Vector2f) LenSq() float32

func (Vector2f) Lerp

func (v Vector2f) Lerp(v1 Vector2f, t float32) Vector2f

func (Vector2f) Mid

func (v Vector2f) Mid(v1 Vector2f) Vector2f

func (Vector2f) Mult

func (v Vector2f) Mult(v1 Vector2f) Vector2f

func (Vector2f) Nor

func (v Vector2f) Nor() Vector2f

func (Vector2f) Rotate

func (v Vector2f) Rotate(rad float32) Vector2f

func (Vector2f) Scl

func (v Vector2f) Scl(mag float32) Vector2f

func (Vector2f) String

func (v Vector2f) String() string

func (Vector2f) Sub

func (v Vector2f) Sub(v1 Vector2f) Vector2f

func (Vector2f) SubS

func (v Vector2f) SubS(x, y float32) Vector2f

func (Vector2f) X64

func (v Vector2f) X64() float64

func (Vector2f) Y64

func (v Vector2f) Y64() float64

Jump to

Keyboard shortcuts

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