package
1.6.0
Repository: https://github.com/twpayne/go-geom.git
Documentation: pkg.go.dev

# Packages

# Functions

Angle calculates the angle of the vector from p0 to p1, relative to the positive X-axis.
AngleBetween calculates the un-oriented smallest angle between two vectors.
AngleBetweenOriented calculates the oriented smallest angle between two vectors.
AngleFromOrigin calculates the angle that the vector from (0,0) to p, relative to the positive X-axis.
AngleOrientation returns whether an angle must turn clockwise or counterclockwise overlap another angle.
Centroid calculates the centroid of the geometry.
ConvexHull computes the convex hull of the geometry.
ConvexHullFlat computes the convex hull of the geometry.
Diff computes the un-oriented smallest difference between two angles.
Distance calculates the 2d distance between the two coordinates.
DistanceFromLineToLine computes the distance from a line segment line1(Start/End) to a line segment line2(Start/End) Note: NON-ROBUST! param line1Start - the start point of line1 param line1End - the end point of line1 (must be different to line1Start) param line2Start - the start point of line2 param line2End - the end point of line2 (must be different to line2Start).
DistanceFromPointToLine computes the distance from a point p to a line segment lineStart/lineEnd Note: NON-ROBUST!.
DistanceFromPointToLineString computes the distance from a point to a sequence of line segments.
DoLinesOverlap calculates if the bounding boxes of the two lines (line1End1, line1End2) and (line2End1, line2End2) overlap.
Equal checks if the point starting at start one in array coords1 is equal to the point starting at start2 in the array coords2.
InteriorAngle cmputes the interior angle between two segments of a ring.
IsAcute tests whether the angle between endpoint1-base-endpoint2 is acute.
IsObtuse tests whether the angle between endpoint1-base-endpoint2 is obtuse.
IsOnLine tests whether a point lies on the line segments defined by a list of coordinates.
IsPointInRing tests whether a point lies inside or on a ring.
IsPointWithinLineBounds calculates if the point p lays within the bounds of the line between end points lineEndpoint1 and lineEndpoint2.
IsRingCounterClockwise computes whether a ring defined by an array of geom.Coords is oriented counter-clockwise.
LinearRingsCentroid computes the centroid of all the LinearRings provided as arguments.
LinesCentroid computes the centroid of all the LineStrings provided as arguments.
LocatePointInRing determines whether a point lies in the interior, on the boundary, or in the exterior of a ring.
MultiLineCentroid computes the centroid of the MultiLineString string Algorithm: Compute the average of the midpoints of all line segments weighted by the segment length.
MultiPointCentroid computes the centroid of the multi point argument Algorithm: average of all points in MultiPoint.
MultiPolygonCentroid computes the centroid of an area geometry.
NewAreaCentroidCalculator creates a new instance of the calculator.
NewLineCentroidCalculator creates a new instance of the calculator.
NewPointCentroidCalculator creates a new calculator.
NewRadialSorting creates an implementation sort.Interface which will sort the wrapped coordinate array radially around the focal point.
Normalize computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
NormalizePositive computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ).
OrientationIndex returns the index of the direction of the point <code>q</code> relative to a vector specified by <code>p1-p2</code>.
PerpendicularDistanceFromPointToLine computes the perpendicular distance from a point p to the (infinite) line containing the points lineStart/lineEnd.
PointsCentroid computes the centroid of the point arguments Algorithm: average of all points.
PointsCentroidFlat computes the centroid of the points in the coordinate array.
PolygonsCentroid computes the centroid of an area geometry.
SignedArea computes the signed area for a ring.
Adopted from https://github.com/paulmach/orb/blob/master/simplify/douglas_peucker.go Original license: The MIT License (MIT) Copyright (c) 2017 Paul Mach Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

# Structs

AreaCentroidCalculator is the data structure that contains the centroid calculation data.
LineCentroidCalculator is the data structure that contains the centroid calculation data.
PointCentroidCalculator is the data structure that contains the centroid calculation data.