vec2

package
v0.0.0-...-5d524ee Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Zero = Vec2{0, 0}

	North = Vec2{0, -1}
	South = Vec2{0, 1}
	West  = Vec2{-1, 0}
	East  = Vec2{1, 0}

	CardinalOffsets = []Vec2{North, South, West, East}
)

Functions

This section is empty.

Types

type Vec2

type Vec2 [2]int

func (Vec2) Add

func (v Vec2) Add(v2 Vec2) Vec2

func (Vec2) FlipHorizontal

func (v Vec2) FlipHorizontal() Vec2

func (Vec2) FlipVertical

func (v Vec2) FlipVertical() Vec2

func (Vec2) Length

func (v Vec2) Length() int

func (Vec2) Neg

func (v Vec2) Neg() Vec2

Neg returns the negative of the vector

func (Vec2) Scale

func (v Vec2) Scale(s int) Vec2

func (Vec2) String

func (v Vec2) String() string

func (Vec2) Sub

func (v Vec2) Sub(v2 Vec2) Vec2

Jump to

Keyboard shortcuts

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