points

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Area

func Area(pts []maths.Pt) (a float64)

func BBox

func BBox(pts []maths.Pt) (bb [4]float64)

TODO:gdey — should we return an error?

func Centroid

func Centroid(pts []maths.Pt) (center maths.Pt)

func Paired

func Paired(pts []maths.Pt) ([][2]maths.Pt, error)

func Reverse

func Reverse(a []maths.Pt) []maths.Pt

func RotatePos

func RotatePos(pts []maths.Pt, pos int)

func RotateToLowestsFirst

func RotateToLowestsFirst(pts []maths.Pt)

func SinArea

func SinArea(pts []maths.Pt) (a float64)

func SlopeIntercept

func SlopeIntercept(pt1, pt2 maths.Pt) (m, b float64, defined bool)

func SortAndUnique

func SortAndUnique(pts []maths.Pt) (spts []maths.Pt)

Types

type BoundingBox

type BoundingBox [4]float64

func (BoundingBox) Area

func (bb BoundingBox) Area() float64

func (BoundingBox) ContainBB

func (bb BoundingBox) ContainBB(bb1 [4]float64) bool

func (BoundingBox) Contains

func (bb BoundingBox) Contains(pt maths.Pt) bool

func (BoundingBox) ContainsLine

func (bb BoundingBox) ContainsLine(l maths.Line) bool

func (BoundingBox) LREdges

func (bb BoundingBox) LREdges() [4]maths.Line

func (BoundingBox) PointAt

func (bb BoundingBox) PointAt(i int) maths.Pt

type ByXY

type ByXY []maths.Pt

func (ByXY) Len

func (t ByXY) Len() int

func (ByXY) Less

func (t ByXY) Less(i, j int) bool

func (ByXY) Sort

func (t ByXY) Sort()

func (ByXY) Swap

func (t ByXY) Swap(i, j int)

Jump to

Keyboard shortcuts

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