Interface Triangle2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    IE - is the type of the path elements.
    P - is the type of the points.
    V - is the type of the vectors.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, Serializable, Shape2afp<ST,​IT,​IE,​P,​V,​B>, Shape2D<ST,​IT,​PathIterator2afp<IE>,​P,​V,​B>
    All Known Implementing Classes:
    Triangle2d, Triangle2dfx

    public interface Triangle2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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>>
    extends Shape2afp<ST,​IT,​IE,​P,​V,​B>
    Fonctional interface that represented a 2D triangle on a plane.
    Since:
    13.0
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Stéphane GALLAND, Fevzi OZGUL
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Detail

      • findsClosestFeatureTrianglePoint

        static Triangle2afp.TriangleFeature findsClosestFeatureTrianglePoint​(double tx1,
                                                                             double ty1,
                                                                             double tx2,
                                                                             double ty2,
                                                                             double tx3,
                                                                             double ty3,
                                                                             double px,
                                                                             double py)
        Replies the closest feature of the triangle to the given point.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        px - x coordinate of the reference point.
        py - y coordinate of the reference point.
        Returns:
        the closest triangle feature to the reference point.
      • isCCW

        @Pure
        static boolean isCCW​(double x1,
                             double y1,
                             double x2,
                             double y2,
                             double x3,
                             double y3)
        Replies if three points of a triangle are defined in a counter-clockwise order.
        Parameters:
        x1 - is the X coordinate of the first point
        y1 - is the Y coordinate of the first point
        x2 - is the X coordinate of the second point
        y2 - is the Y coordinate of the second point
        x3 - is the X coordinate of the third point
        y3 - is the Y coordinate of the third point
        Returns:
        true if the three given points are defined in a counter-clockwise order.
      • isCCW

        boolean isCCW()
        Replies if the points of the triangle are defined in a counter-clockwise order.
        Returns:
        true if the triangle points are defined in a counter-clockwise order.
      • containsTrianglePoint

        @Pure
        static boolean containsTrianglePoint​(double tx1,
                                             double ty1,
                                             double tx2,
                                             double ty2,
                                             double tx3,
                                             double ty3,
                                             double px,
                                             double py)
        Replies if the given point is inside the given triangle.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        px - is the point to test.
        py - is the point to test.
        Returns:
        true if the point is inside the triangle; false if not.
      • containsTriangleRectangle

        @Pure
        static boolean containsTriangleRectangle​(double tx1,
                                                 double ty1,
                                                 double tx2,
                                                 double ty2,
                                                 double tx3,
                                                 double ty3,
                                                 double rx,
                                                 double ry,
                                                 double rwidth,
                                                 double rheight)
        Replies if the given point is inside the given triangle.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        rx - is the x coordinate of the rectangle.
        ry - is the y coordinate of the rectangle.
        rwidth - the width of the rectangle.
        rheight - the height of the rectangle.
        Returns:
        true if the rectangle is inside the triangle; false if not.
      • findsClosestFarthestPointsTrianglePoint

        static void findsClosestFarthestPointsTrianglePoint​(double tx1,
                                                            double ty1,
                                                            double tx2,
                                                            double ty2,
                                                            double tx3,
                                                            double ty3,
                                                            double px,
                                                            double py,
                                                            Point2D<?,​?> closest,
                                                            Point2D<?,​?> farthest)
        Replies the closest point to the given point inside the given triangle.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        px - is the point to test.
        py - is the point to test.
        closest - the closest point.
        farthest - the farthest point.
      • calculatesSquaredDistanceTrianglePoint

        @Pure
        static double calculatesSquaredDistanceTrianglePoint​(double tx1,
                                                             double ty1,
                                                             double tx2,
                                                             double ty2,
                                                             double tx3,
                                                             double ty3,
                                                             double px,
                                                             double py)
        Replies the squared distance from the given triangle to the given point.

        Caution: The points of the triangle must be defined in a CCW order.

        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        px - is the point.
        py - is the point.
        Returns:
        the squared distance from the triangle to the point.
        See Also:
        isCCW(double, double, double, double, double, double)
      • intersectsTriangleCircle

        @Pure
        static boolean intersectsTriangleCircle​(double tx1,
                                                double ty1,
                                                double tx2,
                                                double ty2,
                                                double tx3,
                                                double ty3,
                                                double cx,
                                                double cy,
                                                double cradius)
        Replies if a triangle and a circle are intersecting.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        cx - is the center of the circle
        cy - is the center of the circle
        cradius - is the radius of the circle
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsTriangleEllipse

        @Pure
        static boolean intersectsTriangleEllipse​(double tx1,
                                                 double ty1,
                                                 double tx2,
                                                 double ty2,
                                                 double tx3,
                                                 double ty3,
                                                 double ex,
                                                 double ey,
                                                 double ewidth,
                                                 double eheight)
        Replies if a triangle and an ellipse are intersecting.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        ex - is the position of the ellipse
        ey - is the position of the ellipse
        ewidth - is the width of the ellipse
        eheight - is the height of the ellipse
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsTriangleSegment

        @Pure
        static boolean intersectsTriangleSegment​(double tx1,
                                                 double ty1,
                                                 double tx2,
                                                 double ty2,
                                                 double tx3,
                                                 double ty3,
                                                 double sx1,
                                                 double sy1,
                                                 double sx2,
                                                 double sy2)
        Replies if a triangle and a segment are intersecting.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        sx1 - x coordinate of the first point of the segment.
        sy1 - y coordinate of the first point of the segment.
        sx2 - x coordinate of the second point of the segment.
        sy2 - y coordinate of the second point of the segment.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsTriangleTriangle

        @Pure
        static boolean intersectsTriangleTriangle​(double t1x1,
                                                  double t1y1,
                                                  double t1x2,
                                                  double t1y2,
                                                  double t1x3,
                                                  double t1y3,
                                                  double t2x1,
                                                  double t2y1,
                                                  double t2x2,
                                                  double t2y2,
                                                  double t2x3,
                                                  double t2y3)
        Replies if two triangles are intersecting. The first triangle must be CCW ordered.
        Parameters:
        t1x1 - x coordinate of the first point of the first triangle.
        t1y1 - y coordinate of the first point of the first triangle.
        t1x2 - x coordinate of the second point of the first triangle.
        t1y2 - y coordinate of the second point of the first triangle.
        t1x3 - x coordinate of the third point of the first triangle.
        t1y3 - y coordinate of the third point of the first triangle.
        t2x1 - x coordinate of the first point of the second triangle.
        t2y1 - y coordinate of the first point of the second triangle.
        t2x2 - x coordinate of the second point of the second triangle.
        t2y2 - y coordinate of the second point of the second triangle.
        t2x3 - x coordinate of the third point of the second triangle.
        t2y3 - y coordinate of the third point of the second triangle.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsTriangleRectangle

        @Pure
        static boolean intersectsTriangleRectangle​(double tx1,
                                                   double ty1,
                                                   double tx2,
                                                   double ty2,
                                                   double tx3,
                                                   double ty3,
                                                   double rx,
                                                   double ry,
                                                   double rwidth,
                                                   double rheight)
        Replies if a triangle and a rectangle are intersecting.
        Parameters:
        tx1 - x coordinate of the first point of the triangle.
        ty1 - y coordinate of the first point of the triangle.
        tx2 - x coordinate of the second point of the triangle.
        ty2 - y coordinate of the second point of the triangle.
        tx3 - x coordinate of the third point of the triangle.
        ty3 - y coordinate of the third point of the triangle.
        rx - x coordinate of the minimum corner of the rectangle.
        ry - y coordinate of the minimum corner of the rectangle.
        rwidth - width of the rectangle.
        rheight - height of the rectangle.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • getX1

        @Pure
        double getX1()
        Replies the first point X.
        Returns:
        the first point x.
      • getY1

        @Pure
        double getY1()
        Replies the first point Y.
        Returns:
        the first point y.
      • getX2

        @Pure
        double getX2()
        Replies the second point X.
        Returns:
        the second point x.
      • getY2

        @Pure
        double getY2()
        Replies the second point Y.
        Returns:
        the second point y.
      • getX3

        @Pure
        double getX3()
        Replies the third point X.
        Returns:
        the third point x.
      • getY3

        @Pure
        double getY3()
        Replies the third point Y.
        Returns:
        the third point y.
      • getP1

        @Pure
        default P getP1()
        Replies the first point.
        Returns:
        a copy of the first point.
      • getP2

        @Pure
        default P getP2()
        Replies the second point.
        Returns:
        a copy of the second point.
      • getP3

        @Pure
        default P getP3()
        Replies the third point.
        Returns:
        a copy of the third point.
      • setP1

        default void setP1​(Point2D<?,​?> point)
        Change the first point.
        Parameters:
        point - the point.
      • setP1

        default void setP1​(double x,
                           double y)
        Change the first point.
        Parameters:
        x - x coordinate of the point.
        y - y coordinate of the point.
      • setP2

        default void setP2​(Point2D<?,​?> point)
        Change the second point.
        Parameters:
        point - the point.
      • setP2

        default void setP2​(double x,
                           double y)
        Change the second point.
        Parameters:
        x - x coordinate of the point.
        y - y coordinate of the point.
      • setP3

        default void setP3​(Point2D<?,​?> point)
        Change the third point.
        Parameters:
        point - the point.
      • setP3

        default void setP3​(double x,
                           double y)
        Change the third point.
        Parameters:
        x - x coordinate of the point.
        y - y coordinate of the point.
      • setX1

        void setX1​(double x)
        Change the x coordinate of the first point.
        Parameters:
        x - x coordinate of the point.
      • setY1

        void setY1​(double y)
        Change the y coordinate of the first point.
        Parameters:
        y - y coordinate of the point.
      • setX2

        void setX2​(double x)
        Change the x coordinate of the second point.
        Parameters:
        x - x coordinate of the point.
      • setY2

        void setY2​(double y)
        Change the y coordinate of the second point.
        Parameters:
        y - y coordinate of the point.
      • setX3

        void setX3​(double x)
        Change the x coordinate of the third point.
        Parameters:
        x - x coordinate of the point.
      • setY3

        void setY3​(double y)
        Change the y coordinate of the third point.
        Parameters:
        y - y coordinate of the point.
      • set

        void set​(double x1,
                 double y1,
                 double x2,
                 double y2,
                 double x3,
                 double y3)
        Change the triangle.
        Parameters:
        x1 - x coordinate of the first point.
        y1 - y coordinate of the first point.
        x2 - x coordinate of the second point.
        y2 - y coordinate of the second point.
        x3 - x coordinate of the third point.
        y3 - y coordinate of the third point.
      • isEmpty

        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 Triangle2afp<?,​?,​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.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Replies the squared value of the minimal distance from this shape to the given point.
        Specified by:
        getDistanceSquared in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        pt - the point.
        Returns:
        squared value of the minimal distance between this shape and the point.
      • getDistanceL1

        @Pure
        default double getDistanceL1​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).
        Specified by:
        getDistanceL1 in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        pt - the point
        Returns:
        the distance.
      • getDistanceLinf

        @Pure
        default double getDistanceLinf​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].
        Specified by:
        getDistanceLinf in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        pt - the point
        Returns:
        the distance.
      • 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 Triangle2afp<?,​?,​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.
      • intersects

        @Pure
        default boolean intersects​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given ellipse.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given circle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given line.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given triangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> sorientedRectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        sorientedRectangle - the oriented rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given parallelogram.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(PathIterator2afp<?> iterator)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the shape representing the given path iterator.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        iterator - the path iterator.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given multishape.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Triangle2afp<?,​?,​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:
        multishape - the multishape.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • getClosestPointTo

        @Pure
        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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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 Triangle2afp<?,​?,​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.