java.lang.Object
de.lmu.ifi.dbs.elki.math.geometry.GrahamScanConvexHull2D
Classes to compute the convex hull of a set of points in 2D, using the
classic Grahams scan. Also computes a bounding box.
- Author:
- Erich Schubert
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a single point to the list (this does not compute the hull!)getHull()
Compute the convex hull, and return the resulting polygon.protected final int
Test whether a point is left of the other wrt. the origin.
-
Constructor Details
-
GrahamScanConvexHull2D
public GrahamScanConvexHull2D()Constructor.
-
-
Method Details
-
add
Add a single point to the list (this does not compute the hull!)- Parameters:
point
- Point to add
-
isLeft
Test whether a point is left of the other wrt. the origin.- Parameters:
a
- Vector Ab
- Vector Bo
- Origin vector- Returns:
- +1 when left, 0 when same, -1 when right
-
getHull
Compute the convex hull, and return the resulting polygon.- Returns:
- Polygon of the hull
-