points

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: MIT Imports: 7 Imported by: 3

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 BBoxFloat64 added in v0.6.0

func BBoxFloat64(pts ...[2]float64) (bb [2][2]float64, err 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) []maths.Pt

Types

type BoundingBox

type BoundingBox [4]float64

func (BoundingBox) Area

func (bb BoundingBox) Area() float64

func (BoundingBox) AsGeoJSON added in v0.6.0

func (bb BoundingBox) AsGeoJSON() string

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) ConvertSRID added in v0.6.0

func (bb BoundingBox) ConvertSRID(fromID, toID uint64) BoundingBox

func (BoundingBox) DisjointBB added in v0.6.0

func (bb BoundingBox) DisjointBB(bbox2 [4]float64) 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)

type Extent added in v0.6.0

type Extent [2][2]float64

Extent describes a retangular region.

func (Extent) Area added in v0.6.0

func (e Extent) Area() float64

Area returns the are of the Extent.

func (Extent) Contains added in v0.6.0

func (e Extent) Contains(pt [2]float64) bool

Contains return weather the point is contained by the Extent.

func (Extent) ContainsExtent added in v0.6.0

func (e Extent) ContainsExtent(ee Extent) bool

ContainsExtent returns weather the points of the second extent are containted by the first extent.

func (Extent) ContainsLine added in v0.6.0

func (e Extent) ContainsLine(line [2][2]float64) bool

ContainsLine returns weather both points of the line are contained by the Extent.

func (Extent) ContainsPoints added in v0.6.0

func (e Extent) ContainsPoints(pts ...[2]float64) bool

ContainsPoints returns weather all the given points are contained by the Extent.

func (Extent) Edges added in v0.6.0

func (e Extent) Edges() [][2][2]float64

Edges return in clockwise order the edges that make up this extent. And edge is a line made up of two points.

func (Extent) InclusiveContainsLine added in v0.6.0

func (e Extent) InclusiveContainsLine(line [2][2]float64) bool

func (Extent) IntersectPt added in v0.6.0

func (e Extent) IntersectPt(ln [2][2]float64) (pts [][2]float64, ok bool)

IntersectPt returns the intersect point if one exists.

func (Extent) LREdges added in v0.6.0

func (e Extent) LREdges() [][2][2]float64

LREdges returns the edges of the region so that the upper left most edges to the lower right edges are returned. Basically sorting by the x values first then the y values.

func (Extent) LowerLeft added in v0.6.0

func (e Extent) LowerLeft() [2]float64

func (Extent) LowerRight added in v0.6.0

func (e Extent) LowerRight() [2]float64

func (Extent) TopLeft added in v0.6.0

func (e Extent) TopLeft() [2]float64

func (Extent) TopRight added in v0.6.0

func (e Extent) TopRight() [2]float64

func (Extent) Verticies added in v0.6.0

func (e Extent) Verticies() [][2]float64

Verticies return the verticies of the Extent.

Jump to

Keyboard shortcuts

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