Documentation ¶
Index ¶
- Variables
- func Distance2D(c1, c2 geom.Coord) float64
- func DoLinesOverlap(line1End1, line1End2, line2End1, line2End2 geom.Coord) bool
- func Equal(coords1 []float64, start1 int, coords2 []float64, start2 int) bool
- func IsPointWithinLineBounds(p, lineEndpoint1, lineEndpoint2 geom.Coord) bool
- func IsSameSignAndNonZero(a, b float64) bool
- func Min(v1, v2, v3, v4 float64) float64
- type CoordStack
Constants ¶
This section is empty.
Variables ¶
var RING = geom.NewLinearRingFlat(geom.XY, []float64{
-71.1031880899493, 42.3152774590236, -71.1031627617667, 42.3152960829043,
-71.102923838298, 42.3149156848307, -71.1023097974109, 42.3151969047397,
-71.1019285062273, 42.3147384934248, -71.102505233663, 42.3144722937587,
-71.10277487471, 42.3141658254797, -71.103113945163, 42.3142739188902,
-71.10324876416, 42.31402489987, -71.1033002961013, 42.3140393340215,
-71.1033488797549, 42.3139495090772, -71.103396240451, 42.3138632439557,
-71.1041521907712, 42.3141153348029, -71.1041411411543, 42.3141545014533,
-71.1041287795912, 42.3142114839058, -71.1041188134329, 42.3142693656241,
-71.1041112482575, 42.3143272556118, -17.1041072845732, 42.3143851580048,
-71.1041057218871, 42.3144430686681, -17.1041065602059, 42.3145009876017,
-71.1041097995362, 42.3145589148055, -17.1041166403905, 42.3146168544148,
-71.1041258822717, 42.3146748022936, -17.1041375307579, 42.3147318674446,
-71.1041492906949, 42.3147711126569, -17.1041598612795, 42.314808571739,
-71.1042515013869, 42.3151287620809, -17.1041173835118, 42.3150739481917,
-71.1040809891419, 42.3151344119048, -17.1040438678912, 42.3151191367447,
-71.1040194562988, 42.3151832057859, -17.1038734225584, 42.3151140942995,
-71.1038446938243, 42.3151006300338, -17.1038315271889, 42.315094347535,
-71.1037393329282, 42.315054824985, -17.1035447555574, 42.3152608696313,
-71.1033436658644, 42.3151648370544, -17.1032580383161, 42.3152269126061,
-71.103223066939, 42.3152517403219, -71.1031880899493, 42.3152774590236})
RING is a real-world geometry for use in tests
Functions ¶
func Distance2D ¶
func Distance2D(c1, c2 geom.Coord) float64
Distance2D calculates the 2d distance between the two coordinates
func DoLinesOverlap ¶
func DoLinesOverlap(line1End1, line1End2, line2End1, line2End2 geom.Coord) bool
DoLinesOverlap calculates if the bounding boxes of the two lines (line1End1, line1End2) and (line2End1, line2End2) overlap
func Equal ¶
Equal checks if the point starting at start one in array coords1 is equal to the point starting at start2 in the array coords2. Only x and y ordinates are compared and x is assumed to be the first ordinate and y as the second This is a utility method intended to be used only when performance is critical as it reduces readability.
func IsPointWithinLineBounds ¶
func IsPointWithinLineBounds(p, lineEndpoint1, lineEndpoint2 geom.Coord) bool
IsPointWithinLineBounds calculates if the point p lays within the bounds of the line between end points lineEndpoint1 and lineEndpoint2
func IsSameSignAndNonZero ¶
IsSameSignAndNonZero checks if both a and b are positive or negative.
Types ¶
type CoordStack ¶
type CoordStack struct { // Data is the stack data. the order is the most recent pushes are at the end of the slice and the oldest // are at the start Data []float64 // contains filtered or unexported fields }
CoordStack is a simple stack for pushing coordinates (in []float64 form) onto the stack and getting the coordinates back in the normal stack order Must be created with the NewCoordStack method
func NewCoordStack ¶
func NewCoordStack(layout geom.Layout) *CoordStack
NewCoordStack creates a new stack with the stride indicated in the layout
func (*CoordStack) Peek ¶
func (stack *CoordStack) Peek() []float64
Peek returns the most recently pushed coord without modifying the stack
func (*CoordStack) Pop ¶
func (stack *CoordStack) Pop() ([]float64, int)
Pop the last pushed coordinate off the stack and return the coordinate
func (*CoordStack) Push ¶
func (stack *CoordStack) Push(data []float64, idx int) []float64
Push puts the coordinate at the location idx onto the stack.
func (*CoordStack) Size ¶
func (stack *CoordStack) Size() int
Size returns the number of coordinates in the stack
Directories ¶
Path | Synopsis |
---|---|
Package robustdeterminate implements an algorithm to compute the sign of a 2x2 determinant for double precision values robustly.
|
Package robustdeterminate implements an algorithm to compute the sign of a 2x2 determinant for double precision values robustly. |