Package arc.math.geom
Class ConvexHull
java.lang.Object
arc.math.geom.ConvexHull
Computes the convex hull of a set of points using the monotone chain convex hull algorithm (aka Andrew's algorithm).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeIndices
(float[] polygon, boolean sorted, boolean yDown) computeIndices
(float[] points, int offset, int count, boolean sorted, boolean yDown) Computes a hull the same ascomputePolygon(float[], int, int, boolean)
but returns indices of the specified points.computeIndices
(FloatSeq points, boolean sorted, boolean yDown) computePolygon
(float[] polygon, boolean sorted) computePolygon
(float[] points, int offset, int count, boolean sorted) Returns the convex hull polygon for the given point cloud.computePolygon
(FloatSeq points, boolean sorted)
-
Constructor Details
-
ConvexHull
public ConvexHull()
-
-
Method Details
-
computePolygon
-
computePolygon
-
computePolygon
Returns the convex hull polygon for the given point cloud.- Parameters:
points
- x,y pairs describing points. Duplicate points will result in undefined behavior.sorted
- If false, the points will be sorted by the x coordinate then the y coordinate, which is required by the convex hull algorithm. If sorting is done the input array is not modified and count additional working memory is needed.- Returns:
- pairs of coordinates that describe the convex hull polygon in counterclockwise order. Note the returned array is reused for later calls to the same method.
-
computeIndices
-
computeIndices
-
computeIndices
Computes a hull the same ascomputePolygon(float[], int, int, boolean)
but returns indices of the specified points.
-