Interface Rectangle1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    P - is the type of the points.
    V - is the type of the vectors.
    S - is the type of the segments.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, RectangularShape1afp<ST,​IT,​P,​V,​S,​B>, Serializable, Shape1afp<ST,​IT,​P,​V,​S,​B>, Shape1D<ST,​IT,​P,​V,​S,​B>
    All Known Implementing Classes:
    Rectangle1d, Rectangle1dfx

    public interface Rectangle1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
    extends RectangularShape1afp<ST,​IT,​P,​V,​S,​B>
    Fonctional interface that represented a 2D rectangle on a plane.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Stéphane GALLAND, Hamza JAFFALI
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Detail

      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        Replies the squared value of the minimal distance from this shape to the given point.
        Specified by:
        getDistanceSquared in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point.
        Returns:
        squared value of the minimal distance between this shape and the point.
      • getDistanceL1

        @Pure
        default double getDistanceL1​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        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 Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point
        Returns:
        the distance.
      • getDistanceLinf

        @Pure
        default double getDistanceLinf​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        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 Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point
        Returns:
        the distance.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        Replies the point on the shape that is closest to the given point.
        Specified by:
        getClosestPointTo in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Rectangle1afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape1afp
        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 Shape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getFarthestPointTo

        @Pure
        default P getFarthestPointTo​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        Replies the point on the shape that is farthest the given point.
        Specified by:
        getFarthestPointTo in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point.
        Returns:
        the farthest point on the shape.
      • intersects

        @Pure
        default boolean intersects​(Rectangle1afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape1afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • contains

        @Pure
        default boolean contains​(Segment1D<?,​?> segment,
                                 double x,
                                 double y)
        Description copied from interface: Shape1afp
        Replies if the given point is inside this shape.
        Specified by:
        contains in interface Shape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        segment - the segment to test.
        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.
      • contains

        @Pure
        default boolean contains​(Rectangle1afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape1afp
        Replies if the given rectangle is inside this shape.
        Specified by:
        contains in interface Shape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        true if the given rectangle is inside this shape, otherwise false.
      • equalsToShape

        @Pure
        default boolean equalsToShape​(IT shape)
        Description copied from interface: Shape1D
        Replies this shape is equal to the given shape.
        Specified by:
        equalsToShape in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Rectangle1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if this shape is equal is equal to the given path.