points

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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