point

package
v0.0.0-...-abf69a9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UP    = Direction{-1, 0}
	RIGHT = Direction{0, 1}
	DOWN  = Direction{1, 0}
	LEFT  = Direction{0, -1}
	TL    = Direction{-1, -1}
	TR    = Direction{-1, 1}
	BL    = Direction{1, -1}
	BR    = Direction{1, 1}
)
View Source
var DIRECTIONS = []Direction{UP, RIGHT, DOWN, LEFT}
View Source
var DIRECTIONS9 = []Direction{UP, RIGHT, DOWN, LEFT, TL, TR, BL, BR}

Functions

This section is empty.

Types

type Direction

type Direction Point

type Point

type Point struct {
	I int
	J int
}

func NewPoint

func NewPoint(i int, j int) Point

func (*Point) Clone

func (p *Point) Clone() Point

func (*Point) Distance

func (p *Point) Distance(p2 Point) Point

func (*Point) Equal

func (p *Point) Equal(p2 Point) bool

func (*Point) Hash

func (p *Point) Hash() string

func (*Point) InsideBounds

func (p *Point) InsideBounds(iMin int, jMin int, iMax int, jMax int) bool

func (*Point) Sum

func (p *Point) Sum(p2 Point)

func (*Point) SumNew

func (p *Point) SumNew(p2 Point) Point

func (*Point) Symmetric

func (p *Point) Symmetric() Point

Jump to

Keyboard shortcuts

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