Package com.mindee.geometry
Class PolygonUtils
- java.lang.Object
-
- com.mindee.geometry.PolygonUtils
-
public final class PolygonUtils extends Object
Methods for working with Polygons. Used internally, use at your own risk.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Polygoncombine(Polygon base, Polygon target)Merge the coordinates of the two polygons.static PointgetCentroid(List<Point> vertices)Get the central coordinates (centroid) of a list of Points.static MinMaxgetMinMaxX(List<Point> vertices)Get the maximum and minimum X coordinates in a given list of Points.static MinMaxgetMinMaxY(List<Point> vertices)Get the maximum and minimum Y coordinates in a given list of Points.static booleanisPointInPolygonY(Point centroid, Polygon polygon)Determine if a Point is within a Polygon's Y axis.static booleanisPointInY(Point centroid, Double yMin, Double yMax)Determine if a Point is within two Y coordinates.
-
-
-
Method Detail
-
getCentroid
public static Point getCentroid(List<Point> vertices)
Get the central coordinates (centroid) of a list of Points.
-
getMinMaxY
public static MinMax getMinMaxY(List<Point> vertices)
Get the maximum and minimum Y coordinates in a given list of Points.
-
getMinMaxX
public static MinMax getMinMaxX(List<Point> vertices)
Get the maximum and minimum X coordinates in a given list of Points.
-
isPointInY
public static boolean isPointInY(Point centroid, Double yMin, Double yMax)
Determine if a Point is within two Y coordinates.
-
isPointInPolygonY
public static boolean isPointInPolygonY(Point centroid, Polygon polygon)
Determine if a Point is within a Polygon's Y axis.
-
-