intgeom

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package intgeom stores primitives for integer geometry

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) Add added in v1.1.0

func (p Point) Add(p2 Point) Point

Add sums the location of a second point onto the Point

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