Interface Parallelogram2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static void calculatesCenterPointAxisExtents​(Iterable<? extends Point2D<?,​?>> points, Vector2D<?,​?> raxis, Vector2D<?,​?> saxis, Point2D<?,​?> center, Tuple2D<?> extents)
      Compute the center point and axis extents of a parallelogram from a set of points and the parallelogram axes.
      static void calculatesOrthogonalAxes​(Iterable<? extends Point2D<?,​?>> points, Vector2D<?,​?> raxis, Vector2D<?,​?> saxis)
      Compute the axes of an oriented bounding rectangle that is enclosing the set of points.
      default void clear()
      Reset this shape to be equivalent to an just-created instance of this shape type.
      default boolean contains​(double x, double y)
      Replies if the given point is inside this shape.
      default boolean contains​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies if the given rectangle is inside this shape.
      static boolean containsParallelogramPoint​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double px, double py)
      Replies if a point is inside in the parallelogram.
      static boolean containsParallelogramRectangle​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)
      Replies if a rectangle is inside the parallelogram.
      default boolean equalsToShape​(IT shape)
      Replies this shape is equal to the given shape.
      static void findsClosestPointPointParallelogram​(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,​?> closest)
      Given a point p, this function computes the point q1 on (or in) this parallelogram, closest to p; and the point q2 on the parallelogram, farthest to p.
      static void findsFarthestPointPointParallelogram​(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,​?> farthest)
      Given a point p, this function computes the point q2 on the parallelogram, farthest to p.
      static double findsVectorProjectionRAxisPoint​(double rx, double ry, double sx, double sy, double x, double y)
      Project the given vector on the R (first) axis, according to the direction of the S (second) axis.
      static double findsVectorProjectionSAxisVector​(double rx, double ry, double sx, double sy, double x, double y)
      Project the given vector on the S (second) axis, according to the direction of the R (first) axis.
      P getCenter()
      Replies the center.
      double getCenterX()
      Replies the center x.
      double getCenterY()
      Replies the center y.
      default P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
      Replies the closest point on this shape to the given circle.
      default P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
      Replies the closest point on this shape to the given ellipse.
      default P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
      Replies the closest point on this shape to the given oriented rectangle.
      default P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
      Replies the closest point on this shape to the given parallelogram.
      default P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
      Replies the closest point on this shape to the given path.
      default P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies the closest point on this shape to the given rectangle.
      default P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
      Replies the closest point on this shape to the given round rectangle.
      default P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
      Replies the closest point on this shape to the given segment.
      default P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
      Replies the closest point on this shape to the given triangle.
      default P getClosestPointTo​(Point2D<?,​?> pt)
      Replies the point on the shape that is closest to the given point.
      default double getDistanceL1​(Point2D<?,​?> pt)
      Computes the L-1 (Manhattan) distance between this shape and point p1.
      default double getDistanceLinf​(Point2D<?,​?> pt)
      Computes the L-infinite distance between this shape and point p1.
      default double getDistanceSquared​(Point2D<?,​?> pt)
      Replies the squared value of the minimal distance from this shape to the given point.
      default P getFarthestPointTo​(Point2D<?,​?> pt)
      Replies the point on the shape that is farthest the given point.
      V getFirstAxis()
      Replies the first axis of the oriented rectangle.
      double getFirstAxisExtent()
      Replies the demi-size of the rectangle along its first axis.
      double getFirstAxisX()
      Replies coordinate x of the first axis of the oriented rectangle.
      double getFirstAxisY()
      Replies coordinate y of the first axis of the oriented rectangle.
      default PathIterator2afp<IE> getPathIterator​(Transform2D transform)
      Replies the elements of the paths.
      V getSecondAxis()
      Replies the second axis of the oriented rectangle.
      double getSecondAxisExtent()
      Replies the demi-size of the rectangle along its second axis.
      double getSecondAxisX()
      Replies coordinate x of the second axis of the oriented rectangle.
      double getSecondAxisY()
      Replies coordinate y of the second axis of the oriented rectangle.
      default boolean intersects​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
      Replies if this shape is intersecting the given circle.
      default boolean intersects​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
      Replies if this shape is intersecting the given ellipse.
      default boolean intersects​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
      Replies if this shape is intersecting the given multishape.
      default boolean intersects​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
      Replies if this shape is intersecting the given parallelogram.
      default boolean intersects​(PathIterator2afp<?> iterator)
      Replies if this shape is intersecting the shape representing the given path iterator.
      default boolean intersects​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
      Replies if this shape is intersecting the given line.
      default boolean intersects​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
      Replies if this shape is intersecting the given triangle.
      static boolean intersectsParallelogramCircle​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double circleX, double circleY, double circleRadius)
      Replies if the specified parallelogram intersects the specified circle.
      static boolean intersectsParallelogramEllipse​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double ex, double ey, double ewidth, double eheight)
      Replies if the parallelogram intersects the given ellipse.
      static boolean intersectsParallelogramParallelogram​(double centerX1, double centerY1, double axis1X1, double axis1Y1, double axis1Extent1, double axis2X1, double axis2Y1, double axis2Extent1, double centerX2, double centerY2, double axis1X2, double axis1Y2, double axis1Extent2, double axis2X2, double axis2Y2, double axis2Extent2)
      Replies if two parallelograms intersect.
      static <T extends PathElement2afp>
      boolean
      intersectsParallelogramPathIterator​(double centerX, double centerY, double axis1X, double axis1Y, double extent1, double axis2X, double axis2Y, double extent2, PathIterator2afp<T> pathIterator)
      Tests if the interior of the specified PathIterator2afp intersects the interior of a specified set of oriented rectangular coordinates.
      static boolean intersectsParallelogramRectangle​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)
      Replies if the parallelogram intersects the given rectangle.
      static boolean intersectsParallelogramRoundRectangle​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight, double rArcWidth, double rArcHeight)
      Replies if the parallelogram intersects the given rectangle.
      static boolean intersectsParallelogramSegment​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double s1x, double s1y, double s2x, double s2y)
      Replies if the specified parallelogram intersects the specified segment.
      static boolean intersectsParallelogramTriangle​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double tx1, double ty1, double tx2, double ty2, double tx3, double ty3)
      Replies if the specified parallelogram intersects the specified triangle.
      default boolean isCCW()
      Replies if the axes of the parallelogram are defined in a counter-clockwise order.
      default boolean isEmpty()
      Replies if this shape is empty.
      default void rotate​(double angle)
      Roate the parallelogram around its center.
      void set​(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent)
      Set the oriented rectangle.
      default void set​(IT parallelogram)
      Set this shape with the attributes of the given shape.
      default void set​(Point2D<?,​?> center, Vector2D<?,​?> axis1, double axis1Extent, Vector2D<?,​?> axis2, double axis2Extent)
      Set the parallelogram.
      void setCenter​(double cx, double cy)
      Set the center.
      default void setCenter​(Point2D<?,​?> center)
      Set the center.
      void setCenterX​(double cx)
      Set the center's x.
      void setCenterY​(double cy)
      Set the center's y.
      default void setFirstAxis​(double x, double y)
      Set the first axis of the rectangle.
      void setFirstAxis​(double x, double y, double extent)
      Set the first axis of the rectangle.
      default void setFirstAxis​(Vector2D<?,​?> axis)
      Set the first axis of the rectangle.
      default void setFirstAxis​(Vector2D<?,​?> axis, double extent)
      Set the first axis of the rectangle.
      void setFirstAxisExtent​(double extent)
      Change the demi-size of the rectangle along its first axis.
      default void setFromPointCloud​(Iterable<? extends Point2D<?,​?>> pointCloud)
      Set the parallelogram from a could of points.
      default void setFromPointCloud​(Point2D<?,​?>... pointCloud)
      Set the oriented rectangle from a could of points.
      default void setSecondAxis​(double x, double y)
      Set the second axis of the rectangle.
      void setSecondAxis​(double x, double y, double extent)
      Set the second axis of the rectangle.
      default void setSecondAxis​(Vector2D<?,​?> axis)
      Set the second axis of the rectangle.
      default void setSecondAxis​(Vector2D<?,​?> axis, double extent)
      Set the second axis of the rectangle.
      void setSecondAxisExtent​(double extent)
      Change the demi-size of the rectangle along its second axis.
      default void toBoundingBox​(B box)
      Replies the bounds of the shape.
      default void translate​(double dx, double dy)
      Translate the shape.
    • Method Detail

      • calculatesOrthogonalAxes

        static void calculatesOrthogonalAxes​(Iterable<? extends Point2D<?,​?>> points,
                                             Vector2D<?,​?> raxis,
                                             Vector2D<?,​?> saxis)
        Compute the axes of an oriented bounding rectangle that is enclosing the set of points.
        Parameters:
        points - is the list of the points enclosed by the OBR.
        raxis - is the vector where the R axis of the OBR is put. If null, S must be not null.
        saxis - is the vector where the S axis of the OBR is put. If null, R must be not null.
        See Also:
        "MGPCG pages 219-221"
      • findsClosestPointPointParallelogram

        static void findsClosestPointPointParallelogram​(double px,
                                                        double py,
                                                        double centerX,
                                                        double centerY,
                                                        double axis1X,
                                                        double axis1Y,
                                                        double axis1Extent,
                                                        double axis2X,
                                                        double axis2Y,
                                                        double axis2Extent,
                                                        Point2D<?,​?> closest)
        Given a point p, this function computes the point q1 on (or in) this parallelogram, closest to p; and the point q2 on the parallelogram, farthest to p. If there are several points, the function will return one of those. Remember this function may return an approximate result when points remain on parallelogram plane of symmetry.
        Parameters:
        px - is the X coordinate of the point to test.
        py - is the Y coordinate of the point to test.
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 vector.
        axis1Y - is the Y coordinate of the axis 1 vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 vector.
        axis2Y - is the Y coordinate of the axis 2 vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        closest - the closest point.
      • findsFarthestPointPointParallelogram

        static void findsFarthestPointPointParallelogram​(double px,
                                                         double py,
                                                         double centerX,
                                                         double centerY,
                                                         double axis1X,
                                                         double axis1Y,
                                                         double axis1Extent,
                                                         double axis2X,
                                                         double axis2Y,
                                                         double axis2Extent,
                                                         Point2D<?,​?> farthest)
        Given a point p, this function computes the point q2 on the parallelogram, farthest to p. If there are several points, the function will return one of those. Remember this function may return an approximate result when points remain on parallelogram plane of symmetry.
        Parameters:
        px - is the X coordinate of the point to test.
        py - is the Y coordinate of the point to test.
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 vector.
        axis1Y - is the Y coordinate of the axis 1 vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 vector.
        axis2Y - is the Y coordinate of the axis 2 vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        farthest - the farthest point.
      • containsParallelogramPoint

        @Pure
        static boolean containsParallelogramPoint​(double centerX,
                                                  double centerY,
                                                  double axis1X,
                                                  double axis1Y,
                                                  double axis1Extent,
                                                  double axis2X,
                                                  double axis2Y,
                                                  double axis2Extent,
                                                  double px,
                                                  double py)
        Replies if a point is inside in the parallelogram.
        Parameters:
        px - is the X coordinate of the point to test.
        py - is the Y coordinate of the point to test.
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        Returns:
        true if the given point is inside the parallelogram; otherwise false.
      • containsParallelogramRectangle

        @Pure
        static boolean containsParallelogramRectangle​(double centerX,
                                                      double centerY,
                                                      double axis1X,
                                                      double axis1Y,
                                                      double axis1Extent,
                                                      double axis2X,
                                                      double axis2Y,
                                                      double axis2Extent,
                                                      double rx,
                                                      double ry,
                                                      double rwidth,
                                                      double rheight)
        Replies if a rectangle is inside the parallelogram.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        rx - is the X coordinate of the lower point of the rectangle.
        ry - is the Y coordinate of the lower point of the rectangle.
        rwidth - is the width of the rectangle.
        rheight - is the height of the rectangle.
        Returns:
        true if the given rectangle is inside the parallelogram; otherwise false.
      • intersectsParallelogramSegment

        @Pure
        static boolean intersectsParallelogramSegment​(double centerX,
                                                      double centerY,
                                                      double axis1X,
                                                      double axis1Y,
                                                      double axis1Extent,
                                                      double axis2X,
                                                      double axis2Y,
                                                      double axis2Extent,
                                                      double s1x,
                                                      double s1y,
                                                      double s2x,
                                                      double s2y)
        Replies if the specified parallelogram intersects the specified segment.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the OBB.
        s1x - is the X coordinate of the first point of the segment.
        s1y - is the Y coordinate of the first point of the segment.
        s2x - is the X coordinate of the second point of the segment.
        s2y - is the Y coordinate of the second point of the segment.
        Returns:
        true if intersecting, otherwise false
      • intersectsParallelogramTriangle

        @Pure
        static boolean intersectsParallelogramTriangle​(double centerX,
                                                       double centerY,
                                                       double axis1X,
                                                       double axis1Y,
                                                       double axis1Extent,
                                                       double axis2X,
                                                       double axis2Y,
                                                       double axis2Extent,
                                                       double tx1,
                                                       double ty1,
                                                       double tx2,
                                                       double ty2,
                                                       double tx3,
                                                       double ty3)
        Replies if the specified parallelogram intersects the specified triangle.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the OBB.
        tx1 - is the X coordinate of the first point of the triangle.
        ty1 - is the Y coordinate of the first point of the triangle.
        tx2 - is the X coordinate of the second point of the triangle.
        ty2 - is the Y coordinate of the second point of the triangle.
        tx3 - is the X coordinate of the third point of the triangle.
        ty3 - is the Y coordinate of the third point of the triangle.
        Returns:
        true if intersecting, otherwise false
      • intersectsParallelogramCircle

        @Pure
        static boolean intersectsParallelogramCircle​(double centerX,
                                                     double centerY,
                                                     double axis1X,
                                                     double axis1Y,
                                                     double axis1Extent,
                                                     double axis2X,
                                                     double axis2Y,
                                                     double axis2Extent,
                                                     double circleX,
                                                     double circleY,
                                                     double circleRadius)
        Replies if the specified parallelogram intersects the specified circle.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        circleX - is the coordinate of the circle center.
        circleY - is the coordinate of the circle center.
        circleRadius - is the radius of the circle.
        Returns:
        true if intersecting, otherwise false
      • intersectsParallelogramEllipse

        @Pure
        static boolean intersectsParallelogramEllipse​(double centerX,
                                                      double centerY,
                                                      double axis1X,
                                                      double axis1Y,
                                                      double axis1Extent,
                                                      double axis2X,
                                                      double axis2Y,
                                                      double axis2Extent,
                                                      double ex,
                                                      double ey,
                                                      double ewidth,
                                                      double eheight)
        Replies if the parallelogram intersects the given ellipse.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        ex - is the coordinate of the min point of the ellipse rectangle.
        ey - is the coordinate of the min point of the ellipse rectangle.
        ewidth - is the width of the ellipse.
        eheight - is the height of the ellipse.
        Returns:
        true if intersecting, otherwise false
      • intersectsParallelogramRectangle

        @Pure
        static boolean intersectsParallelogramRectangle​(double centerX,
                                                        double centerY,
                                                        double axis1X,
                                                        double axis1Y,
                                                        double axis1Extent,
                                                        double axis2X,
                                                        double axis2Y,
                                                        double axis2Extent,
                                                        double rx,
                                                        double ry,
                                                        double rwidth,
                                                        double rheight)
        Replies if the parallelogram intersects the given rectangle.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        rx - is the X coordinate of the lower point of the rectangle.
        ry - is the Y coordinate of the lower point of the rectangle.
        rwidth - is the width of the rectangle.
        rheight - is the height of the rectangle.
        Returns:
        true if intersecting, otherwise false.
      • intersectsParallelogramParallelogram

        @Pure
        static boolean intersectsParallelogramParallelogram​(double centerX1,
                                                            double centerY1,
                                                            double axis1X1,
                                                            double axis1Y1,
                                                            double axis1Extent1,
                                                            double axis2X1,
                                                            double axis2Y1,
                                                            double axis2Extent1,
                                                            double centerX2,
                                                            double centerY2,
                                                            double axis1X2,
                                                            double axis1Y2,
                                                            double axis1Extent2,
                                                            double axis2X2,
                                                            double axis2Y2,
                                                            double axis2Extent2)
        Replies if two parallelograms intersect.
        Parameters:
        centerX1 - is the X coordinate of the first parallelogram center.
        centerY1 - is the Y coordinate of the first parallelogram center.
        axis1X1 - is the X coordinate of the axis 1 unit vector.
        axis1Y1 - is the Y coordinate of the axis 1 unit vector.
        axis1Extent1 - is the extent of the axis 1 of the first parallelogram.
        axis2X1 - is the X coordinate of the axis 2 unit vector.
        axis2Y1 - is the Y coordinate of the axis 2 unit vector.
        axis2Extent1 - is the extent of the axis 2 of the first parallelogram.
        centerX2 - is the X coordinate of the second parallelogram center.
        centerY2 - is the Y coordinate of the second parallelogram center.
        axis1X2 - is the X coordinate of the axis 1 unit vector.
        axis1Y2 - is the Y coordinate of the axis 1 unit vector.
        axis1Extent2 - is the extent of the axis 1 of the second parallelogram.
        axis2X2 - is the X coordinate of the axis 2 unit vector.
        axis2Y2 - is the Y coordinate of the axis 2 unit vector.
        axis2Extent2 - is the extent of the axis 2 of the second parallelogram.
        Returns:
        true if intersecting, otherwise false.
      • intersectsParallelogramRoundRectangle

        @Pure
        static boolean intersectsParallelogramRoundRectangle​(double centerX,
                                                             double centerY,
                                                             double axis1X,
                                                             double axis1Y,
                                                             double axis1Extent,
                                                             double axis2X,
                                                             double axis2Y,
                                                             double axis2Extent,
                                                             double rx,
                                                             double ry,
                                                             double rwidth,
                                                             double rheight,
                                                             double rArcWidth,
                                                             double rArcHeight)
        Replies if the parallelogram intersects the given rectangle.
        Parameters:
        centerX - is the X coordinate of the parallelogram center.
        centerY - is the Y coordinate of the parallelogram center.
        axis1X - is the X coordinate of the axis 1 unit vector.
        axis1Y - is the Y coordinate of the axis 1 unit vector.
        axis1Extent - is the extent of the axis 1 of the parallelogram.
        axis2X - is the X coordinate of the axis 2 unit vector.
        axis2Y - is the Y coordinate of the axis 2 unit vector.
        axis2Extent - is the extent of the axis 2 of the parallelogram.
        rx - is the X coordinate of the lower point of the rectangle.
        ry - is the Y coordinate of the lower point of the rectangle.
        rwidth - is the width of the rectangle.
        rheight - is the height of the rectangle.
        rArcWidth - is the width of the rectangle arcs.
        rArcHeight - is the height of the rectangle arcs.
        Returns:
        true if intersecting, otherwise false.
      • intersectsParallelogramPathIterator

        static <T extends PathElement2afp> boolean intersectsParallelogramPathIterator​(double centerX,
                                                                                       double centerY,
                                                                                       double axis1X,
                                                                                       double axis1Y,
                                                                                       double extent1,
                                                                                       double axis2X,
                                                                                       double axis2Y,
                                                                                       double extent2,
                                                                                       PathIterator2afp<T> pathIterator)
        Tests if the interior of the specified PathIterator2afp intersects the interior of a specified set of oriented rectangular coordinates.
        Type Parameters:
        T - the type of the path elements to iterate on.
        Parameters:
        centerX - the specified X coordinate of the rectangle center.
        centerY - the specified Y coordinate of the rectangle center.
        axis1X - the X coordinate of the first axis of the parallelogram.
        axis1Y - the Y coordinate of the first axis of the parallelogram.
        extent1 - the extent the rectangle along the first axis.
        axis2X - the X coordinate of the second axis of the parallelogram.
        axis2Y - the Y coordinate of the second axis of the parallelogram.
        extent2 - the extent the rectangle along the second axis.
        pathIterator - the specified PathIterator2afp.
        Returns:
        true if the specified PathIterator2afp and the interior of the specified set of rectangular coordinates intersect each other; false otherwise.
      • getCenter

        @Pure
        P getCenter()
        Replies the center.
        Returns:
        the center.
      • getCenterX

        @Pure
        double getCenterX()
        Replies the center x.
        Returns:
        the center x.
      • getCenterY

        @Pure
        double getCenterY()
        Replies the center y.
        Returns:
        the center y.
      • setCenter

        void setCenter​(double cx,
                       double cy)
        Set the center.
        Parameters:
        cx - the center x.
        cy - the center y.
      • setCenter

        default void setCenter​(Point2D<?,​?> center)
        Set the center.
        Parameters:
        center - the center point.
      • setCenterX

        void setCenterX​(double cx)
        Set the center's x.
        Parameters:
        cx - the center x.
      • setCenterY

        void setCenterY​(double cy)
        Set the center's y.
        Parameters:
        cy - the center y.
      • getFirstAxis

        @Pure
        V getFirstAxis()
        Replies the first axis of the oriented rectangle.
        Returns:
        the unit vector of the first axis.
      • getFirstAxisX

        @Pure
        double getFirstAxisX()
        Replies coordinate x of the first axis of the oriented rectangle.
        Returns:
        the coordinate x of the unit vector of the first axis.
      • getFirstAxisY

        @Pure
        double getFirstAxisY()
        Replies coordinate y of the first axis of the oriented rectangle.
        Returns:
        the coordinate y of the unit vector of the first axis.
      • getSecondAxis

        @Pure
        V getSecondAxis()
        Replies the second axis of the oriented rectangle.
        Returns:
        the unit vector of the second axis.
      • getSecondAxisX

        @Pure
        double getSecondAxisX()
        Replies coordinate x of the second axis of the oriented rectangle.
        Returns:
        the coordinate x of the unit vector of the second axis.
      • getSecondAxisY

        @Pure
        double getSecondAxisY()
        Replies coordinate y of the second axis of the oriented rectangle.
        Returns:
        the coordinate y of the unit vector of the second axis.
      • getFirstAxisExtent

        @Pure
        double getFirstAxisExtent()
        Replies the demi-size of the rectangle along its first axis.
        Returns:
        the extent along the first axis.
      • setFirstAxisExtent

        void setFirstAxisExtent​(double extent)
        Change the demi-size of the rectangle along its first axis.
        Parameters:
        extent - - the extent along the first axis.
      • getSecondAxisExtent

        @Pure
        double getSecondAxisExtent()
        Replies the demi-size of the rectangle along its second axis.
        Returns:
        the extent along the second axis.
      • setSecondAxisExtent

        void setSecondAxisExtent​(double extent)
        Change the demi-size of the rectangle along its second axis.
        Parameters:
        extent - - the extent along the second axis.
      • setFirstAxis

        default void setFirstAxis​(Vector2D<?,​?> axis)
        Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.
        Parameters:
        axis - - the new values for the first axis.
      • setFirstAxis

        default void setFirstAxis​(Vector2D<?,​?> axis,
                                  double extent)
        Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.
        Parameters:
        axis - - the new values for the first axis.
        extent - - the extent of the axis.
      • setFirstAxis

        default void setFirstAxis​(double x,
                                  double y)
        Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.
        Parameters:
        x - x coordinate of the first axis.
        y - y coordinate of the first axis.
      • setFirstAxis

        void setFirstAxis​(double x,
                          double y,
                          double extent)
        Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.
        Parameters:
        x - x coordinate of the first axis.
        y - y coordinate of the first axis.
        extent - the demi-size of th parallelogram along the first axis.
      • setSecondAxis

        default void setSecondAxis​(Vector2D<?,​?> axis)
        Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.
        Parameters:
        axis - - the new values for the first axis.
      • setSecondAxis

        default void setSecondAxis​(Vector2D<?,​?> axis,
                                   double extent)
        Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.
        Parameters:
        axis - - the new values for the first axis.
        extent - - the extent of the axis.
      • setSecondAxis

        default void setSecondAxis​(double x,
                                   double y)
        Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.
        Parameters:
        x - - the new values for the first axis.
        y - - the new values for the first axis.
      • setSecondAxis

        void setSecondAxis​(double x,
                           double y,
                           double extent)
        Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.
        Parameters:
        x - x coordinate of the second axis.
        y - y coordinate of the second axis.
        extent - the demi-size of the parallelogram along the second axis.
      • isEmpty

        @Pure
        default boolean isEmpty()
        Description copied from interface: Shape2D
        Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.
        Specified by:
        isEmpty in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Returns:
        true if the shape is empty; false otherwise.
      • set

        default void set​(Point2D<?,​?> center,
                         Vector2D<?,​?> axis1,
                         double axis1Extent,
                         Vector2D<?,​?> axis2,
                         double axis2Extent)
        Set the parallelogram.
        Parameters:
        center - is the parallelogram center.
        axis1 - is the first axis of the parallelogram.
        axis1Extent - is the extent of the first axis.
        axis2 - is the second axis of the parallelogram.
        axis2Extent - is the extent of the second axis.
      • set

        void set​(double centerX,
                 double centerY,
                 double axis1X,
                 double axis1Y,
                 double axis1Extent,
                 double axis2X,
                 double axis2Y,
                 double axis2Extent)
        Set the oriented rectangle.
        Parameters:
        centerX - is the X coordinate of the OBR center.
        centerY - is the Y coordinate of the OBR center.
        axis1X - is the X coordinate of first axis of the OBR.
        axis1Y - is the Y coordinate of first axis of the OBR.
        axis1Extent - is the extent of the first axis.
        axis2X - is the X coordinate of second axis of the OBR.
        axis2Y - is the Y coordinate of second axis of the OBR.
        axis2Extent - is the extent of the second axis.
      • setFromPointCloud

        default void setFromPointCloud​(Iterable<? extends Point2D<?,​?>> pointCloud)
        Set the parallelogram from a could of points.

        This function changes the axes to be orthogonal.

        Parameters:
        pointCloud - - the cloud of points.
        Since:
        14.0
      • setFromPointCloud

        default void setFromPointCloud​(Point2D<?,​?>... pointCloud)
        Set the oriented rectangle from a could of points.
        Parameters:
        pointCloud - - the cloud of points.
        Since:
        14.0
      • rotate

        default void rotate​(double angle)
        Roate the parallelogram around its center.
        Parameters:
        angle - the angle of rotation.
      • contains

        @Pure
        default boolean contains​(double x,
                                 double y)
        Description copied from interface: Shape2afp
        Replies if the given point is inside this shape.
        Specified by:
        contains in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        x - x coordinate of the point to test.
        y - y coordinate of the point to test.
        Returns:
        true if the given point is inside this shape, otherwise false.
      • getClosestPointTo

        default P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given circle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        circle - the circle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given ellipse.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        ellipse - the ellipse.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given segment.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        segment - the segment.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given triangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        triangle - the triangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given oriented rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        orientedRectangle - the oriented rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given parallelogram.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        parallelogram - the parallelogram.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given round rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given path.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Parallelogram2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        path - the path.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • isCCW

        default boolean isCCW()
        Replies if the axes of the parallelogram are defined in a counter-clockwise order.
        Returns:
        true if the paralelogram axes are defined in a counter-clockwise order.