vector

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vector

type Vector struct {
	X float64
	Y float64
	Z float64
}

func Add

func Add(v1, v2 Vector) Vector

func DivScalar

func DivScalar(v Vector, scalar float64) Vector

func MultScalar

func MultScalar(v Vector, scalar float64) Vector

func New2DVector

func New2DVector(x, y float64) Vector

func Sub

func Sub(v1, v2 Vector) Vector

func (*Vector) Add

func (v *Vector) Add(other Vector)

func (Vector) DistanceTo

func (v Vector) DistanceTo(other Vector) float64

func (*Vector) DivScalar

func (v *Vector) DivScalar(scalar float64)

func (Vector) Dot

func (v Vector) Dot(other Vector) float64

func (Vector) Magnitude

func (v Vector) Magnitude() float64

func (*Vector) MultScalar

func (v *Vector) MultScalar(scalar float64)

func (Vector) Normal2D

func (v Vector) Normal2D() Vector

func (*Vector) Sub

func (v *Vector) Sub(other Vector)

func (Vector) Unit

func (v Vector) Unit() Vector

Jump to

Keyboard shortcuts

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