public class ConvexPolygon2d extends Polygon2d
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
ConvexPolygon2d() |
ConvexPolygon2d(double[] coords) |
ConvexPolygon2d(Point2d[] pnts) |
Modifier and Type | Method and Description |
---|---|
double |
area() |
void |
computeAndSetHull(java.util.List<Point2d> input,
double angTol) |
static java.util.ArrayList<Point2d> |
computeHull(java.util.List<Point2d> input,
double angTol)
Computes a 2D convex hull for a set of input points, using the Monotone
Chain algorithm, by A.
|
static int[] |
computeHullIndices(java.util.Collection<Point2d> input,
double angTol)
Computes the indices of a 2D convex hull within a set of input points,
using the Monotone Chain algorithm, by A.
|
static java.util.ArrayList<Point2d> |
computeOld(java.util.Collection<Point2d> input,
double tol)
Computes a 2D convex hull from a set on input points, using the Graham
Scan algorithm, which is O(n log n).
|
int |
pointIsInside(Point2d pnt)
Returns 1 or -1 depending on whether pnt is (strictly) inside or outside
of poly.
|
addVertex, appendVertex, clear, computeArea, computeAreaIntegrals, computeLength, createRenderProps, epsilonEquals, equals, getBounds, getCentroid, getFirstVertex, getLastVertex, getMaxCoordinate, getPoints, getRenderHints, getRenderProps, getSelection, getVertices, intersectRay, inverseTransform, isConsistent, isConvex, isConvex, isEmpty, isSelectable, iterator, nearestEdge, numSelectionQueriesNeeded, numVertices, prependVertex, prerender, render, render, scan, set, set, set, set, set, setRenderProps, shiftFirstVertex, shiftVertices, simpleConvexHull, simpleConvexHull, toString, toString, toString, transform, updateBounds, updateBounds
public ConvexPolygon2d()
public ConvexPolygon2d(double[] coords)
public ConvexPolygon2d(Point2d[] pnts)
public double area()
public static java.util.ArrayList<Point2d> computeOld(java.util.Collection<Point2d> input, double tol)
public static int[] computeHullIndices(java.util.Collection<Point2d> input, double angTol)
input
- points from which the hull should be formedangTol
- if > 0
, specifies an angular tolerance which should
be used to remove nearly colinear pointsinput
which
form the hull, in counter-clockwise orderpublic static java.util.ArrayList<Point2d> computeHull(java.util.List<Point2d> input, double angTol)
input
- points from which the hull should be formedangTol
- if > 0
, specifies an angular tolerance which should
be used to remove nearly colinear pointsinput
, which form the hull
in counter-clockwise orderpublic void computeAndSetHull(java.util.List<Point2d> input, double angTol)
public int pointIsInside(Point2d pnt)