Documentation
¶
Index ¶
- Constants
- func AreLinesColinear(l1, l2 geom.Line) bool
- func DistanceToLineSegment(p geom.Pointer, v geom.Pointer, w geom.Pointer) float64
- func IsPointOnLine(compare cmp.Compare, pt [2]float64, l1, l2 [2]float64) bool
- func IsPointOnLineSegment(compare cmp.Compare, pt geom.Point, seg geom.Line) bool
- func LineIntersect(l1, l2 geom.Line) (pt [2]float64, ok bool)
- func LineIntersectBigFloat(l1, l2 geom.Line) (pt [2]*big.Float, ok bool)
- func NormalizeLines(lines []geom.Line)
- func NormalizeUniqueLines(lines []geom.Line) []geom.Line
- func PerpendicularDistance(line [2][2]float64, point [2]float64) float64
- func PointDistance(p1 geom.Pointer, p2 geom.Pointer) float64
- func PointDistance2(p1 geom.Pointer, p2 geom.Pointer) float64
- func PointOnLineAt(ln geom.Line, distance float64) geom.Point
- func PointsCentriod(pts ...[2]float64) (center [2]float64)
- func SegmentIntersect(l1, l2 geom.Line) (pt [2]float64, ok bool)
- func Simplify(ctx context.Context, simplifer Simplifer, geometry geom.Geometry) (geom.Geometry, error)
- func Slope(line [2][2]float64) (m, b float64, defined bool)
- type Clipper
- type HitMapper
- type Label
- type LinesByLength
- type LinesByXY
- type MakeValider
- type PointLineDistanceFunc
- type Simplifer
Constants ¶
const ( // Experimental testing produced this result. // For finding the intersect we need higher precision. // Then geom.PrecisionLevelBigFloat PrecisionLevelBigFloat = 110 )
const Rad = math.Pi / 180
Rad is the factor to go from pi to radians
Variables ¶
This section is empty.
Functions ¶
func AreLinesColinear ¶
AreLinesColinear check if the two lines are colinear based on the slope formula
func DistanceToLineSegment ¶
DistanceToLineSegment calculates the distance from point p to line segment v, w.
Taken from: https://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment
func IsPointOnLine ¶
IsPointOnLine checks if pt is on the lines l1, l2 by checking slope and intersect form
func IsPointOnLineSegment ¶
IsPointOnLineSegment checks if pt is on the line segment (seg)
func LineIntersect ¶
LineIntersect find the intersection point (x,y) between two lines if there is one. Ok will be true if it found an interseciton point. ok being false, means there isn't just one intersection point, there could be zero, or more then one. ref: https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line
func LineIntersectBigFloat ¶
LineIntersectBigFloat find the intersection point (x,y) between two lines if there is one. Ok will be true if it found an interseciton point. Internally uses math/big ok being false, means there isn't just one intersection point, there could be zero, or more then one. ref: https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line
func NormalizeLines ¶
func PerpendicularDistance ¶
PerpendicularDistance provides the distance between a line and a point in Euclidean space. ref: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Line_defined_by_two_points
func PointDistance ¶
PointDistance returns the euclidean distance between two points.
func PointDistance2 ¶
PointDistance2 returns the euclidean distance between two points squared.
This can be a useful optimization in some routines where d^2 is good enough.
func PointOnLineAt ¶
PointOnLineAt will return a point on the given line at the distance from the origin of the line
func PointsCentriod ¶
PointsCentriod returns the center of the given pts
func SegmentIntersect ¶
SegmentIntersect will find the intersection point (x,y) between two lines if there is one. Ok will be true if it found an intersection point and if the point is on both lines. ref: https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line
Types ¶
type Label ¶
type Label uint8
Label is the the label for the triangle. Is in "inside" or "outside". TODO: gdey — would be make more sense to just have a bool here? IsInside or somthing like that?
type LinesByLength ¶
func (LinesByLength) Len ¶
func (l LinesByLength) Len() int
func (LinesByLength) Less ¶
func (l LinesByLength) Less(i, j int) bool
func (LinesByLength) Swap ¶
func (l LinesByLength) Swap(i, j int)
type MakeValider ¶
type MakeValider interface { // Makevalid will take a possibility invalid geometry and an optional clipbox, returning a valid geometry, weather it clipped the geometry, or an error if one occured. Makevalid(ctx context.Context, geo geom.Geometry, clipbox *geom.Extent) (geometry geom.Geometry, didClip bool, err error) }
type PointLineDistanceFunc ¶
PointLineDistanceFunc is the abstract method to get the distance from point to a line depending on projection
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
utm
Package utm provides the ability to work with UTM coordinates
|
Package utm provides the ability to work with UTM coordinates |
index
|
|
kdtree
kdtree is a two dimensional kd-tree implementation
|
kdtree is a two dimensional kd-tree implementation |
delaunay/quadedge
Package quadedge describes a quadedge object used to build up the triangulation A quadedge is made up of four directional edges
|
Package quadedge describes a quadedge object used to build up the triangulation A quadedge is made up of four directional edges |