Package georegression.geometry
Class UtilPolygons2D_I32
java.lang.Object
georegression.geometry.UtilPolygons2D_I32
Various functions related to polygons.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
bounding
(Polygon2D_I32 quad, Rectangle2D_I32 rectangle) Finds the minimum area bounding rectangle which is aligned to the x and y axis around the polygon.static void
bounding
(List<Point2D_I32> points, Rectangle2D_I32 rectangle) Finds the minimum area bounding rectangle which is aligned to the x and y axis around the list of points.static void
Flips the order of points inside the polygon.static boolean
isCCW
(List<Point2D_I32> polygon) Returns true if the polygon is ordered in a counter-clockwise order.static boolean
isConvex
(Polygon2D_I32 poly) Determines if the polugon is convex or concave.static boolean
Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance and allows for a shift in their orderstatic boolean
Checks to see if the vertexes of the two polygon's are the same up to the specified tolerancestatic boolean
isPositiveZ
(Point2D_I32 a, Point2D_I32 b, Point2D_I32 c) Returns true if the cross product would result in a strictly positive z (e.g.
-
Constructor Details
-
UtilPolygons2D_I32
public UtilPolygons2D_I32()
-
-
Method Details
-
bounding
Finds the minimum area bounding rectangle which is aligned to the x and y axis around the list of points. Note (x0,y0) is inclusive and (x1,y1) is exclusive.- Parameters:
points
- (Input) Quadrilateralrectangle
- (Output) Minimum area rectangle
-
bounding
Finds the minimum area bounding rectangle which is aligned to the x and y axis around the polygon. Note (x0,y0) is inclusive and (x1,y1) is exclusive.- Parameters:
quad
- (Input) Quadrilateralrectangle
- (Output) Minimum area rectangle
-
isCCW
Returns true if the polygon is ordered in a counter-clockwise order. This is done by summing up the interior angles.- Parameters:
polygon
- List of ordered points which define a polygon- Returns:
- true if CCW and false if CW
-
flip
Flips the order of points inside the polygon. The first index will remain the same will otherwise be reversed- Parameters:
a
- Polygon of order 3 or more.
-
isConvex
Determines if the polugon is convex or concave.- Parameters:
poly
- Polygon- Returns:
- true if convex and false if concave
-
isPositiveZ
Returns true if the cross product would result in a strictly positive z (e.g. z > 0 ). If true then the order is clockwise. v0 = a-b v1 = c-b- Parameters:
a
- first point in sequenceb
- second point in sequencec
- third point in sequence- Returns:
- true if positive z
-
isIdentical
Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance- Parameters:
a
- Polygonb
- Polygon- Returns:
- true if identical up to tolerance or false if not
-
isEquivalent
Checks to see if the vertexes of the two polygon's are the same up to the specified tolerance and allows for a shift in their order- Parameters:
a
- Polygonb
- Polygon- Returns:
- true if identical up to tolerance or false if not
-