intgeom

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2017 License: Apache-2.0 Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y int
}

Point is a basic integer pair

func NewPoint

func NewPoint(x, y int) Point

NewPoint returns an (X,Y) point structure

func (Point) Distance

func (p Point) Distance(p2 Point) float64

Distance is the euclidean distance function

type Rect

type Rect struct {
	Min Point
	Max Point
}

Rect is a basic integer pair with width / height

func NewRect

func NewRect(x, y, x2, y2 int) Rect

NewRect returns an (X,Y):(X2,Y2) rectangle

func NewRectWH

func NewRectWH(x, y, w, h int) Rect

NewRectWH returns an (X,Y):(X+W,Y+H) rectangle

func ShuffleRects

func ShuffleRects(rs []Rect) []Rect

ShuffleRects is a utility function to randomize the order of a rectangle set

Jump to

Keyboard shortcuts

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