Interface Rectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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,OrientedRectangle2afp<ST,IT,IE,P,V,B>,Parallelogram2afp<ST,IT,IE,P,V,B>,RectangularShape2afp<ST,IT,IE,P,V,B>,Serializable,Shape2afp<ST,IT,IE,P,V,B>,Shape2D<ST,IT,PathIterator2afp<IE>,P,V,B>
- All Known Implementing Classes:
Rectangle2d,Rectangle2dfx
public interface Rectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 RectangularShape2afp<ST,IT,IE,P,V,B>, OrientedRectangle2afp<ST,IT,IE,P,V,B>
Fonctional interface that represented a 2D rectangle on a plane.- Since:
- 13.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRectangle2afp.RectanglePathIterator<T extends PathElement2afp>Iterator on the path elements of the rectangle.static classRectangle2afp.TransformedRectanglePathIterator<T extends PathElement2afp>Iterator on the path elements of the rectangle.-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
OrientedRectangle2afp.AbstractOrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.OrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.ProjectionToOrientedRectangleLocalCoordinateSystemPathIterator<T extends PathElement2afp>, OrientedRectangle2afp.TransformedOrientedRectanglePathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
Parallelogram2afp.AbstractParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ProjectionToParallelogramLocalCoordinateSystemPathIterator<T extends PathElement2afp>, Parallelogram2afp.TransformedParallelogramPathIterator<T extends PathElement2afp>
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default voidadd(double x, double y)Add the given coordinate in the rectangle.default voidadd(Point2D<?,?> pt)Add the given coordinate in the rectangle.default voidavoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> result)Move this rectangle to avoid collision with the reference rectangle.default voidavoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> displacementDirection, Vector2D<?,?> result)Move this rectangle to avoid collision with the reference rectangle.static doublecalculatesDistanceSquaredRectanglePoint(double rx, double ry, double rmaxx, double rmaxy, double px, double py)Compute the square distance between a rectangle and a point.static IntersectionTypeclassifiesRectangleRectangle(double lx1, double ly1, double ux1, double uy1, double lx2, double ly2, double ux2, double uy2)Classifies two 2D axis-aligned rectangles.default voidclear()Reset this shape to be equivalent to an just-created instance of this shape type.default booleancontains(double x, double y)Replies if the given point is inside this shape.default booleancontains(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies if the given rectangle is inside this shape.static booleancontainsRectanglePoint(double rx1, double ry1, double rx2, double ry2, double px, double py)Replies if a point is inside in the rectangle.static booleancontainsRectangleRectangle(double enclosingX1, double enclosingY1, double enclosingX2, double enclosingY2, double innerX1, double innerY1, double innerX2, double innerY2)Replies if a rectangle is inside in the rectangle.default BcreateIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)Compute and replies the intersection of this rectangle and the given rectangle.default BcreateUnion(RectangularShape2afp<?,?,?,?,?,?> rect)Compute and replies the union of this rectangle and the given rectangle.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.static voidfindsClosestPointRectangleParallelogram(double rx, double ry, double rmaxx, double rmaxy, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the parallelogram.static voidfindsClosestPointRectanglePoint(double rx, double ry, double rmaxx, double rmaxy, double px, double py, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the given point.static voidfindsClosestPointRectangleRectangle(double rx1, double ry1, double rmaxx1, double rmaxy1, double rx2, double ry2, double rmaxx2, double rmaxy2, Tuple2D<?> closest)Compute the point on the first rectangle that is the closest to the second rectangle.static voidfindsClosestPointRectangleSegment(double rx, double ry, double rmaxx, double rmaxy, double sx1, double sy1, double sx2, double sy2, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the segment.default PgetCenter()Replies the center.default doublegetCenterX()Replies the center x.default doublegetCenterY()Replies the center y.default PgetClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)Replies the closest point on this shape to the given circle.default PgetClosestPointTo(Ellipse2afp<?,?,?,?,?,?> ellipse)Replies the closest point on this shape to the given ellipse.default PgetClosestPointTo(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)Replies the closest point on this shape to the given oriented rectangle.default PgetClosestPointTo(Parallelogram2afp<?,?,?,?,?,?> parallelogram)Replies the closest point on this shape to the given parallelogram.default PgetClosestPointTo(Path2afp<?,?,?,?,?,?> path)Replies the closest point on this shape to the given path.default PgetClosestPointTo(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)Replies the closest point on this shape to the given round rectangle.default PgetClosestPointTo(Segment2afp<?,?,?,?,?,?> segment)Replies the closest point on this shape to the given segment.default PgetClosestPointTo(Triangle2afp<?,?,?,?,?,?> triangle)Replies the closest point on this shape to the given triangle.default PgetClosestPointTo(Point2D<?,?> pt)Replies the point on the shape that is closest to the given point.default doublegetDistanceL1(Point2D<?,?> pt)Computes the L-1 (Manhattan) distance between this shape and point p1.default doublegetDistanceLinf(Point2D<?,?> pt)Computes the L-infinite distance between this shape and point p1.default doublegetDistanceSquared(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies the minimum distance between this shape and the given rectangle.default doublegetDistanceSquared(Point2D<?,?> pt)Replies the squared value of the minimal distance from this shape to the given point.default PgetFarthestPointTo(Point2D<?,?> pt)Replies the point on the shape that is farthest the given point.default VgetFirstAxis()Replies the first axis of the oriented rectangle.default doublegetFirstAxisExtent()Replies the demi-size of the rectangle along its first axis.default doublegetFirstAxisX()Replies coordinate x of the first axis of the oriented rectangle.default doublegetFirstAxisY()Replies coordinate y of the first axis of the oriented rectangle.default PathIterator2afp<IE>getPathIterator(Transform2D transform)Replies the elements of the paths.default VgetSecondAxis()Replies the second axis of the oriented rectangle.default doublegetSecondAxisExtent()Replies the demi-size of the rectangle along its second axis.default doublegetSecondAxisX()Replies coordinate x of the second axis of the oriented rectangle.default doublegetSecondAxisY()Replies coordinate y of the second axis of the oriented rectangle.default booleanintersects(Circle2afp<?,?,?,?,?,?> circle)Replies if this shape is intersecting the given circle.default booleanintersects(Ellipse2afp<?,?,?,?,?,?> ellipse)Replies if this shape is intersecting the given ellipse.default booleanintersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)Replies if this shape is intersecting the given multishape.default booleanintersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)Replies if this shape is intersecting the given parallelogram.default booleanintersects(PathIterator2afp<?> iterator)Replies if this shape is intersecting the shape representing the given path iterator.default booleanintersects(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(Segment2afp<?,?,?,?,?,?> segment)Replies if this shape is intersecting the given line.default booleanintersects(Triangle2afp<?,?,?,?,?,?> triangle)Replies if this shape is intersecting the given triangle.static booleanintersectsRectangleLine(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Replies if two rectangles are intersecting.static booleanintersectsRectangleRectangle(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Replies if two rectangles are intersecting.static booleanintersectsRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2)Replies if the rectangle is intersecting the segment.default booleanisEmpty()Replies if this shape is empty.static intreducesCohenSutherlandZoneRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2, int codePoint1, int codePoint2, Tuple2D<?> newSegmentP1, Tuple2D<?> newSegmentP2)Update the given Cohen-Sutherland code that corresponds to the given segment in order to obtain a segment restricted to a single Cohen-Sutherland zone.default voidset(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2Extent)Set the oriented rectangle.default voidset(IT shape)Set this shape with the attributes of the given shape.default voidsetCenter(double cx, double cy)Set the center.default voidsetCenterX(double cx)Set the center's x.default voidsetCenterY(double cy)Set the center's y.default voidsetFirstAxis(double x, double y, double extent)Set the first axis of the rectangle.default voidsetFirstAxisExtent(double extent)Change the demi-size of the rectangle along its first axis.default voidsetFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)Set the parallelogram from a could of points.default voidsetIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)Compute the intersection of this rectangle and the given rectangle.default voidsetSecondAxis(double x, double y, double extent)Set the second axis of the rectangle.default voidsetSecondAxisExtent(double extent)Change the demi-size of the rectangle along its second axis.default voidsetUnion(RectangularShape2afp<?,?,?,?,?,?> rect)Compute the union of this rectangle and the given rectangle and change this rectangle with the result of the union.default voidtoBoundingBox(B box)Replies the bounds of the shape.default voidtranslate(double dx, double dy)Translate the shape.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
rotate, set, set
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
isCCW, set, setCenter, setFirstAxis, setFirstAxis, setFirstAxis, setFromPointCloud, setSecondAxis, setSecondAxis, setSecondAxis
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.RectangularShape2afp
getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, inflate, set, set, setFromCenter, setFromCenter, setFromCorners, setFromCorners, setHeight, setMaxX, setMaxY, setMinX, setMinY, setWidth
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Method Detail
-
findsClosestPointRectanglePoint
static void findsClosestPointRectanglePoint(double rx, double ry, double rmaxx, double rmaxy, double px, double py, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the given point.- Parameters:
rx- the minimum x coordinate of the rectangle.ry- the minimum y coordinate of the rectangle.rmaxx- the maximum x coordinate of the rectangle.rmaxy- the maximum y coordinate of the rectangle.px- the x coordinate of the point.py- the y coordinate of the point.closest- is set with the closest point on the rectangle.
-
findsClosestPointRectangleRectangle
static void findsClosestPointRectangleRectangle(double rx1, double ry1, double rmaxx1, double rmaxy1, double rx2, double ry2, double rmaxx2, double rmaxy2, Tuple2D<?> closest)Compute the point on the first rectangle that is the closest to the second rectangle.- Parameters:
rx1- the minimum x coordinate of the first rectangle.ry1- the minimum y coordinate of the first rectangle.rmaxx1- the maximum x coordinate of the first rectangle.rmaxy1- the maximum y coordinate of the first rectangle.rx2- the minimum x coordinate of the second rectangle.ry2- the minimum y coordinate of the second rectangle.rmaxx2- the maximum x coordinate of the second rectangle.rmaxy2- the maximum y coordinate of the second rectangle.closest- is set with the closest point on the first rectangle.
-
findsClosestPointRectangleSegment
static void findsClosestPointRectangleSegment(double rx, double ry, double rmaxx, double rmaxy, double sx1, double sy1, double sx2, double sy2, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the segment.- Parameters:
rx- the minimum x coordinate of the rectangle.ry- the minimum y coordinate of the rectangle.rmaxx- the maximum x coordinate of the rectangle.rmaxy- the maximum y coordinate of the rectangle.sx1- the x coordinate of the first point of the segment.sy1- the y coordinate of the first point of the segment.sx2- the x coordinate of the second point of the segment.sy2- the y coordinate of the second point of the segment.closest- is set with the closest point on the rectangle.
-
findsClosestPointRectangleParallelogram
static void findsClosestPointRectangleParallelogram(double rx, double ry, double rmaxx, double rmaxy, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Tuple2D<?> closest)Compute the point on the rectangle that is the closest to the parallelogram.- Parameters:
rx- the minimum x coordinate of the rectangle.ry- the minimum y coordinate of the rectangle.rmaxx- the maximum x coordinate of the rectangle.rmaxy- the maximum y coordinate of the rectangle.centerX- the x coordinate of the center of the parallelogram.centerY- the y coordinate of the center of the parallelogram.axis1X- the x coordinate of the first axis of the parallelogram.axis1Y- the y coordinate of the first axis of the parallelogram.axis1Extent- the size of the parallelogram along its first axis.axis2X- the x coordinate of the second axis of the parallelogram.axis2Y- the y coordinate of the secondaxis of the parallelogram.axis2Extent- the size of the parallelogram along its second axis.closest- is set with the closest point on the first rectangle.
-
reducesCohenSutherlandZoneRectangleSegment
static int reducesCohenSutherlandZoneRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2, int codePoint1, int codePoint2, Tuple2D<?> newSegmentP1, Tuple2D<?> newSegmentP2)Update the given Cohen-Sutherland code that corresponds to the given segment in order to obtain a segment restricted to a single Cohen-Sutherland zone. This function is at the heart of the Cohen-Sutherland algorithm.The result of this function may be:
- the code for a single zone, or
- the code that corresponds to a single column, or
- the code that corresponds to a single row.
- Parameters:
rx1- is the first corner of the rectangle.ry1- is the first corner of the rectangle.rx2- is the second corner of the rectangle.ry2- is the second corner of the rectangle.sx1- is the first point of the segment.sy1- is the first point of the segment.sx2- is the second point of the segment.sy2- is the second point of the segment.codePoint1- the Cohen-Sutherland code for the first point of the segment.codePoint2- the Cohen-Sutherland code for the second point of the segment.newSegmentP1- is set with the new coordinates of the segment first point. Ifnull, this parameter is ignored.newSegmentP2- is set with the new coordinates of the segment second point. Ifnull, this parameter is ignored.- Returns:
- the rectricted Cohen-Sutherland zone.
-
calculatesDistanceSquaredRectanglePoint
@Pure static double calculatesDistanceSquaredRectanglePoint(double rx, double ry, double rmaxx, double rmaxy, double px, double py)Compute the square distance between a rectangle and a point.- Parameters:
rx- the minimum x coordinate of the rectangle.ry- the minimum y coordinate of the rectangle.rmaxx- the maximum x coordinate of the rectangle.rmaxy- the maximum y coordinate of the rectangle.px- the x coordinate of the point.py- the y coordinate of the point.- Returns:
- the square distance.
-
intersectsRectangleRectangle
@Pure static boolean intersectsRectangleRectangle(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Replies if two rectangles are intersecting.- Parameters:
x1- is the first corner of the first rectangle.y1- is the first corner of the first rectangle.x2- is the second corner of the first rectangle.y2- is the second corner of the first rectangle.x3- is the first corner of the second rectangle.y3- is the first corner of the second rectangle.x4- is the second corner of the second rectangle.y4- is the second corner of the second rectangle.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsRectangleLine
@Pure static boolean intersectsRectangleLine(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)Replies if two rectangles are intersecting.- Parameters:
x1- is the first corner of the rectangle.y1- is the first corner of the rectangle.x2- is the second corner of the rectangle.y2- is the second corner of the rectangle.x3- is the first point of the line.y3- is the first point of the line.x4- is the second point of the line.y4- is the second point of the line.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsRectangleSegment
@Pure static boolean intersectsRectangleSegment(double rx1, double ry1, double rx2, double ry2, double sx1, double sy1, double sx2, double sy2)Replies if the rectangle is intersecting the segment.- Parameters:
rx1- is the first corner of the rectangle.ry1- is the first corner of the rectangle.rx2- is the second corner of the rectangle.ry2- is the second corner of the rectangle.sx1- is the first point of the segment.sy1- is the first point of the segment.sx2- is the second point of the segment.sy2- is the second point of the segment.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
containsRectangleRectangle
@Pure static boolean containsRectangleRectangle(double enclosingX1, double enclosingY1, double enclosingX2, double enclosingY2, double innerX1, double innerY1, double innerX2, double innerY2)Replies if a rectangle is inside in the rectangle.- Parameters:
enclosingX1- is the lowest corner of the enclosing-candidate rectangle.enclosingY1- is the lowest corner of the enclosing-candidate rectangle.enclosingX2- is the uppest corner of the enclosing-candidate rectangle.enclosingY2- is the uppest corner of the enclosing-candidate rectangle.innerX1- is the lowest corner of the inner-candidate rectangle.innerY1- is the lowest corner of the inner-candidate rectangle.innerX2- is the uppest corner of the inner-candidate rectangle.innerY2- is the uppest corner of the inner-candidate rectangle.- Returns:
trueif the given rectangle is inside the ellipse; otherwisefalse.
-
containsRectanglePoint
@Pure static boolean containsRectanglePoint(double rx1, double ry1, double rx2, double ry2, double px, double py)Replies if a point is inside in the rectangle.- Parameters:
rx1- is the lowest corner of the rectangle.ry1- is the lowest corner of the rectangle.rx2- is the uppest corner of the rectangle.ry2- is the uppest corner of the rectangle.px- is the point.py- is the point.- Returns:
trueif the given point is inside the rectangle; otherwisefalse.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape2DReplies this shape is equal to the given shape.- Specified by:
equalsToShapein interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
equalsToShapein interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
equalsToShapein interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
shape- the shape to compare to.- Returns:
trueif this shape is equal is equal to the given path.
-
set
default void set(IT shape)
Description copied from interface:Shape2DSet this shape with the attributes of the given shape.- Specified by:
setin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
setin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
setin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
setin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
shape- the shape to copy.
-
set
default void set(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2Extent)Set the oriented rectangle. The second axis is automatically computed.The rectangle is always aligned on the global axes. It means that the rectangle is set to the enclosing box related to the given parameters.
- Specified by:
setin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
centerX- is the X coordinate of the oriented rectangle center.centerY- is the Y coordinate of the oriented rectangle center.axis1x- is the X coordinate of first axis of the oriented rectangle.axis1y- is the Y coordinate of first axis of the oriented rectangle.axis1Extent- is the extent of the first axis.axis2Extent- is the extent of the second axis.
-
getDistanceSquared
@Pure default double getDistanceSquared(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquaredin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceSquaredin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceSquaredin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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.
-
getDistanceSquared
default double getDistanceSquared(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies the minimum distance between this shape and the given rectangle.- Specified by:
getDistanceSquaredin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 minimum distance between the two shapes.
-
getDistanceL1
@Pure default double getDistanceL1(Point2D<?,?> pt)
Description copied from interface:Shape2DComputes 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 interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceL1in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceL1in interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:Shape2DComputes 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 interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceLinfin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getDistanceLinfin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:Shape2afpReplies if the given point is inside this shape.- Specified by:
containsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
containsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
containsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif the given point is inside this shape, otherwisefalse.
-
contains
@Pure default boolean contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies if the given rectangle is inside this shape.- Specified by:
containsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
containsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
containsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif the given rectangle is inside this shape, otherwisefalse.
-
add
default void add(Point2D<?,?> pt)
Add the given coordinate in the rectangle.The corners of the rectangles are moved to enclosed the given coordinate.
- Parameters:
pt- the point.
-
add
default void add(double x, double y)Add the given coordinate in the rectangle.The corners of the rectangles are moved for enclosing the given coordinate.
- Parameters:
x- x coordinate of the point.y- y coordinate of the point.
-
createUnion
@Pure default B createUnion(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute and replies the union of this rectangle and the given rectangle. This function does not change this rectangle.It is equivalent to (where
uris the union):Rectangle2f ur = new Rectangle2f(this); ur.setUnion(r);- Parameters:
rect- the rectangular shape.- Returns:
- the union of this rectangle and the given rectangle.
- See Also:
setUnion(RectangularShape2afp)
-
createIntersection
@Pure default B createIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute and replies the intersection of this rectangle and the given rectangle. This function does not change this rectangle.It is equivalent to (where
iris the intersection):Rectangle2f ir = new Rectangle2f(this); ir.setIntersection(r);- Parameters:
rect- the rectangular shape.- Returns:
- the union of this rectangle and the given rectangle.
- See Also:
setIntersection(RectangularShape2afp)
-
setUnion
default void setUnion(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute the union of this rectangle and the given rectangle and change this rectangle with the result of the union.- Parameters:
rect- the rectangular shape.- See Also:
createUnion(RectangularShape2afp)
-
setIntersection
default void setIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute the intersection of this rectangle and the given rectangle. This function changes this rectangle.If there is no intersection, this rectangle is cleared.
- Parameters:
rect- the rectangular shape.- See Also:
createIntersection(RectangularShape2afp),clear()
-
intersects
@Pure default boolean intersects(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given ellipse.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given circle.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given line.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given parallelogram.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
default boolean intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given triangle.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator2afp<?> iterator)
Description copied from interface:Shape2afpReplies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given multishape.- Specified by:
intersectsin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
avoidCollisionWith
default void avoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.- Parameters:
reference- is the rectangle to avoid collision with.result- the displacement vector.
-
avoidCollisionWith
default void avoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> displacementDirection, Vector2D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.- Parameters:
reference- is the rectangle to avoid collision with.displacementDirection- is the direction of the allowed displacement (it is an input). This vector is set according to the result before returning.result- the displacement vector.
-
getClosestPointTo
@Pure default P getClosestPointTo(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the point on the shape that is closest to the given point.- Specified by:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(Path2afp<?,?,?,?,?,?> path)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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.
-
getClosestPointTo
default P getClosestPointTo(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies 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 interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Description copied from interface:Shape2afpReplies 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:
getClosestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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.
-
getFarthestPointTo
@Pure default P getFarthestPointTo(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointToin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getFarthestPointToin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getFarthestPointToin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 farthest point on the shape.
-
getPathIterator
@Pure default PathIterator2afp<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2DReplies the elements of the paths.- Specified by:
getPathIteratorin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getPathIteratorin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getPathIteratorin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
transform- is the transformation to apply to the path.- Returns:
- the elements of the path.
-
getCenter
default P getCenter()
Description copied from interface:RectangularShape2afpReplies the center.- Specified by:
getCenterin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getCenterin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the center.
-
setCenter
default void setCenter(double cx, double cy)Description copied from interface:Parallelogram2afpSet the center.- Specified by:
setCenterin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
cx- the center x.cy- the center y.
-
setCenterX
default void setCenterX(double cx)
Description copied from interface:Parallelogram2afpSet the center's x.- Specified by:
setCenterXin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
cx- the center x.
-
setCenterY
default void setCenterY(double cy)
Description copied from interface:Parallelogram2afpSet the center's y.- Specified by:
setCenterYin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
cy- the center y.
-
getFirstAxis
default V getFirstAxis()
Description copied from interface:Parallelogram2afpReplies the first axis of the oriented rectangle.- Specified by:
getFirstAxisin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the unit vector of the first axis.
-
getFirstAxisX
default double getFirstAxisX()
Description copied from interface:Parallelogram2afpReplies coordinate x of the first axis of the oriented rectangle.- Specified by:
getFirstAxisXin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the coordinate x of the unit vector of the first axis.
-
getFirstAxisY
default double getFirstAxisY()
Description copied from interface:Parallelogram2afpReplies coordinate y of the first axis of the oriented rectangle.- Specified by:
getFirstAxisYin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the coordinate y of the unit vector of the first axis.
-
getSecondAxis
default V getSecondAxis()
Description copied from interface:Parallelogram2afpReplies the second axis of the oriented rectangle.- Specified by:
getSecondAxisin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the unit vector of the second axis.
-
getSecondAxisX
default double getSecondAxisX()
Description copied from interface:Parallelogram2afpReplies coordinate x of the second axis of the oriented rectangle.- Specified by:
getSecondAxisXin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the coordinate x of the unit vector of the second axis.
-
getSecondAxisY
default double getSecondAxisY()
Description copied from interface:Parallelogram2afpReplies coordinate y of the second axis of the oriented rectangle.- Specified by:
getSecondAxisYin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the coordinate y of the unit vector of the second axis.
-
getFirstAxisExtent
default double getFirstAxisExtent()
Description copied from interface:Parallelogram2afpReplies the demi-size of the rectangle along its first axis.- Specified by:
getFirstAxisExtentin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the extent along the first axis.
-
setFirstAxisExtent
default void setFirstAxisExtent(double extent)
Description copied from interface:Parallelogram2afpChange the demi-size of the rectangle along its first axis.- Specified by:
setFirstAxisExtentin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
extent- - the extent along the first axis.
-
getSecondAxisExtent
default double getSecondAxisExtent()
Description copied from interface:Parallelogram2afpReplies the demi-size of the rectangle along its second axis.- Specified by:
getSecondAxisExtentin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the extent along the second axis.
-
setSecondAxisExtent
default void setSecondAxisExtent(double extent)
Description copied from interface:Parallelogram2afpChange the demi-size of the rectangle along its second axis.- Specified by:
setSecondAxisExtentin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
extent- - the extent along the second axis.
-
setFirstAxis
default 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.The rectangle is always aligned on the global axes. It means that the rectangle is set to the enclosing box related to the given parameters.
- Specified by:
setFirstAxisin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 first axis.y- y coordinate of the first axis.extent- the demi-size of th parallelogram along the first axis.
-
setSecondAxis
default 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.The rectangle is always aligned on the global axes. It means that the rectangle is set to the enclosing box related to the given parameters.
- Specified by:
setSecondAxisin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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 second axis.y- y coordinate of the second axis.extent- the demi-size of the parallelogram along the second axis.
-
clear
default void clear()
Description copied from interface:Shape2DReset this shape to be equivalent to an just-created instance of this shape type.- Specified by:
clearin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
clearin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
clearin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
clearin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>
-
getCenterX
default double getCenterX()
Description copied from interface:RectangularShape2afpReplies the center x.- Specified by:
getCenterXin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getCenterXin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the center x.
-
getCenterY
default double getCenterY()
Description copied from interface:RectangularShape2afpReplies the center y.- Specified by:
getCenterYin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
getCenterYin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
- the center y.
-
translate
default void translate(double dx, double dy)Description copied from interface:Shape2afpTranslate the shape.- Specified by:
translatein interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
translatein interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
translatein interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
translatein interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
dx- x translation.dy- y translation.
-
toBoundingBox
default void toBoundingBox(B box)
Description copied from interface:Shape2DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
toBoundingBoxin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
toBoundingBoxin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
toBoundingBoxin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
box- is set with the bounds of the shape.
-
isEmpty
default boolean isEmpty()
Description copied from interface:Shape2DReplies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmptyin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
isEmptyin interfaceRectangularShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
isEmptyin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
trueif the shape is empty;falseotherwise.
-
classifiesRectangleRectangle
static IntersectionType classifiesRectangleRectangle(double lx1, double ly1, double ux1, double uy1, double lx2, double ly2, double ux2, double uy2)
Classifies two 2D axis-aligned rectangles.This function is assuming that lx1 is lower or equal to ux1, ly1 is lower or equal to uy1, and so on.
- Parameters:
lx1- the X coordinate of the lowest point of the first rectangle.ly1- the Y coordinate of the lowest point of the first rectangle.ux1- the X coordinate of the uppest point of the first rectangle.uy1- the Y coordinate of the uppest point of the first rectangle.lx2- the X coordinate of the lowest point of the second rectangle.ly2- the Y coordinate of the lowest point of the second rectangle.ux2- the X coordinate of the uppest point of the second rectangle.uy2- the Y coordinate of the uppest point of the second rectangle.- Returns:
- the value
IntersectionType.INSIDEif the first rectangle is inside the second rectangle;IntersectionType.OUTSIDEif the first rectangle is outside the second rectangle;IntersectionType.ENCLOSINGif the first rectangle is enclosing the second rectangle;IntersectionType.ENCLOSINGif the first rectangle is the same as the second rectangle;IntersectionType.SPANNINGotherwise. - Since:
- 14.0
-
setFromPointCloud
default void setFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)
Description copied from interface:Parallelogram2afpSet the parallelogram from a could of points.This function changes the axes to be orthogonal.
- Specified by:
setFromPointCloudin interfaceOrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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>>- Specified by:
setFromPointCloudin interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Rectangle2afp<?,?,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:
pointCloud- - the cloud of points.
-
-