geometry

package
v0.0.0-...-ef779ba Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 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 VectorFrom

func VectorFrom(direction float64, magnitude float64) *Vector

func Zero

func Zero() *Vector

func (*Vector) Add

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

func (*Vector) AngleTo

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

func (*Vector) DistanceFrom

func (v *Vector) DistanceFrom(other *Vector) 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() Vector

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

Jump to

Keyboard shortcuts

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