Package de.xima.fc.common.geometry
Class Polygon2DDouble
- java.lang.Object
-
- de.xima.fc.common.geometry.Polygon2DDouble
-
public final class Polygon2DDouble extends Object
A 2-dimensional polygon defined by a list of points.- Since:
- 8.4.0
-
-
Constructor Summary
Constructors Constructor Description Polygon2DDouble(Point2DDouble[] points)Creates a polygon from the given points.Polygon2DDouble(Iterable<Point2DDouble> points)Creates a polygon from the given points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rectangle2DDoubleboundingBox()Gets the bounding box of this polygon, i.e. the smallest rectangle that contains all points of the polygon.List<Point2DDouble>points()Gets the list of points that define this polygon.Polygon2DDoubletranslate(double deltaX, double deltaY)Translates this polygon by the given delta values.
-
-
-
Constructor Detail
-
Polygon2DDouble
public Polygon2DDouble(Point2DDouble[] points)
Creates a polygon from the given points.- Parameters:
points- The points that define this polygon.
-
Polygon2DDouble
public Polygon2DDouble(Iterable<Point2DDouble> points)
Creates a polygon from the given points.- Parameters:
points- The points that define this polygon.
-
-
Method Detail
-
boundingBox
public Rectangle2DDouble boundingBox()
Gets the bounding box of this polygon, i.e. the smallest rectangle that contains all points of the polygon.- Returns:
- The bounding box of this polygon.
-
points
public List<Point2DDouble> points()
Gets the list of points that define this polygon.- Returns:
- The points that define this polygon.
-
translate
public Polygon2DDouble translate(double deltaX, double deltaY)
Translates this polygon by the given delta values.- Parameters:
deltaX- The amount to translate in the x direction.deltaY- The amount to translate in the y direction.- Returns:
- A new polygon that is translated by the given delta values.
-
-