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 booleancontains(Rectangle1afp<?,?,?,?,?,?> rectangle)Replies if the given rectangle is inside this shape.default booleancontains(Segment1D<?,?> segment, double x, double y)Replies if the given point is inside this shape.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.default PgetClosestPointTo(Rectangle1afp<?,?,?,?,?,?> rectangle)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(Point1D<?,?,?> pt)Replies the point on the shape that is closest to the given point.default doublegetDistanceL1(Point1D<?,?,?> pt)Computes the L-1 (Manhattan) distance between this shape and point p1.default doublegetDistanceLinf(Point1D<?,?,?> pt)Computes the L-infinite distance between this shape and point p1.default doublegetDistanceSquared(Point1D<?,?,?> pt)Replies the squared value of the minimal distance from this shape to the given point.default PgetFarthestPointTo(Point1D<?,?,?> pt)Replies the point on the shape that is farthest the given point.default booleanintersects(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:Shape1DReplies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquaredin 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:Shape1DComputes 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:
getDistanceL1in 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:Shape1DComputes 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:
getDistanceLinfin 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:Shape1DReplies the point on the shape that is closest to the given point.- Specified by:
getClosestPointToin 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:Shape1afpReplies 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:
getClosestPointToin 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:Shape1DReplies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointToin 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:Shape1afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin 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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
contains
@Pure default boolean contains(Segment1D<?,?> segment, double x, double y)
Description copied from interface:Shape1afpReplies if the given point is inside this shape.- Specified by:
containsin 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:
trueif the given point is inside this shape, otherwisefalse.
-
contains
@Pure default boolean contains(Rectangle1afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape1afpReplies if the given rectangle is inside this shape.- Specified by:
containsin 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:
trueif the given rectangle is inside this shape, otherwisefalse.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape1DReplies this shape is equal to the given shape.- Specified by:
equalsToShapein 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:
trueif this shape is equal is equal to the given path.
-
-