Class Polygon2DDouble


  • public final class Polygon2DDouble
    extends Object
    A 2-dimensional polygon defined by a list of points.
    Since:
    8.4.0
    • 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.