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 Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
contains(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.default boolean
contains(Segment1D<?,?> segment, double x, double y)
Replies if the given point is inside this shape.default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.default P
getClosestPointTo(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(Point1D<?,?,?> pt)
Replies the point on the shape that is closest to the given point.default double
getDistanceL1(Point1D<?,?,?> pt)
Computes the L-1 (Manhattan) distance between this shape and point p1.default double
getDistanceLinf(Point1D<?,?,?> pt)
Computes the L-infinite distance between this shape and point p1.default double
getDistanceSquared(Point1D<?,?,?> pt)
Replies the squared value of the minimal distance from this shape to the given point.default P
getFarthestPointTo(Point1D<?,?,?> pt)
Replies the point on the shape that is farthest the given point.default boolean
intersects(Rectangle1afp<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d1.afp.RectangularShape1afp
clear, getCenter, getCenterX, getCenterY, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, inflate, isEmpty, set, set, set, setFromCenter, setFromCenter, setFromCorners, setFromCorners, setHeight, setMaxX, setMaxY, setMinX, setMinY, setWidth, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d1.afp.Shape1afp
contains, contains, getClosestPointTo, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d1.Shape1D
clone, getDistance, getDistance, getSegment, operator_add, operator_and, operator_and, operator_minus, operator_plus, operator_remove, operator_upTo, setSegment
-
-
-
-
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 interfaceShape1D<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 interfaceShape1D<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 interfaceShape1D<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 interfaceShape1D<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 interfaceShape1afp<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 interfaceShape1D<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 interfaceShape1afp<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 interfaceShape1afp<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, otherwisefalse
.
-
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 interfaceShape1afp<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, otherwisefalse
.
-
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 interfaceShape1D<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.
-
-