geometry

package
v0.0.0-...-0e8056b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dimension

type Dimension struct {
	W float64
	H float64
}

type Vector

type Vector struct {
	X float64
	Y float64
}

func Add

func Add(a, b *Vector) *Vector

func Diff

func Diff(a, b *Vector) *Vector

func VectorFrom

func VectorFrom(direction float64, magnitude float64) *Vector

func Zero

func Zero() *Vector

func (*Vector) Add

func (v *Vector) Add(other *Vector)

func (*Vector) AddAll

func (v *Vector) AddAll(others ...*Vector)

func (*Vector) AngleTo

func (v *Vector) AngleTo(other *Vector) float64

func (*Vector) DistanceFrom

func (v *Vector) DistanceFrom(other *Vector) float64

func (*Vector) Divide

func (v *Vector) Divide(divisor float64)

func (*Vector) Limit

func (v *Vector) Limit(max float64)

func (*Vector) Magnitude

func (v *Vector) Magnitude() float64

func (*Vector) Mod

func (v *Vector) Mod(bounds *Dimension) *Vector

func (*Vector) Normalize

func (v *Vector) Normalize()

func (*Vector) Scale

func (v *Vector) Scale(factor float64)

func (*Vector) SquareDistanceFrom

func (v *Vector) SquareDistanceFrom(other *Vector) float64

func (Vector) String

func (v Vector) String() string

func (*Vector) Subtract

func (v *Vector) Subtract(other *Vector)

Jump to

Keyboard shortcuts

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