| Modifier and Type | Class and Description |
|---|---|
static class |
ConvexPolygon.ConvexHullAlgorithm |
| Constructor and Description |
|---|
ConvexPolygon() |
ConvexPolygon(Point p0,
Point p1,
Point p2)
creates a convex polygon with given three points as corners (counterclockwise)
|
ConvexPolygon(PointSet points,
ConvexPolygon.ConvexHullAlgorithm algorithm)
creates a convex hull of a set of points
Jarvis March O(hn)
Grahams Scan O(nlogn)
|
ConvexPolygon(Polygon pol)
creates a convex hull of a simple polygon in O(n) time
|
| Modifier and Type | Method and Description |
|---|---|
double[][] |
beamDetector() |
boolean |
contains(Point p)
returns true if point p is inside the convex polygon
|
int |
farthestVertex(int p,
int r) |
LineSegment |
getDiameter()
returns the segment between most distant pair of points.
|
deleteLast, draw, draw, getCenter, getConvexPolygon, getCorner, insertAfter, isConvex, leftExtremePointIndx, rightExtremePointIndx, setCorner, shift, toStringadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizepublic ConvexPolygon()
public ConvexPolygon(Polygon pol)
public ConvexPolygon(Point p0, Point p1, Point p2)
public ConvexPolygon(PointSet points, ConvexPolygon.ConvexHullAlgorithm algorithm)
public boolean contains(Point p)
public LineSegment getDiameter()
public double[][] beamDetector()
public int farthestVertex(int p,
int r)