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 class
Rectangle2afp.RectanglePathIterator<T extends PathElement2afp>
Iterator on the path elements of the rectangle.static class
Rectangle2afp.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 void
add(double x, double y)
Add the given coordinate in the rectangle.default void
add(Point2D<?,?> pt)
Add the given coordinate in the rectangle.default void
avoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.default void
avoidCollisionWith(Rectangle2afp<?,?,?,?,?,?> reference, Vector2D<?,?> displacementDirection, Vector2D<?,?> result)
Move this rectangle to avoid collision with the reference rectangle.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.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.default void
clear()
Reset this shape to be equivalent to an just-created instance of this shape type.default boolean
contains(double x, double y)
Replies if the given point is inside this shape.default boolean
contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.static boolean
containsRectanglePoint(double rx1, double ry1, double rx2, double ry2, double px, double py)
Replies if a point is inside in the rectangle.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.default B
createIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute and replies the intersection of this rectangle and the given rectangle.default B
createUnion(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute and replies the union of this rectangle and the given rectangle.default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.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.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.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.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.default P
getCenter()
Replies the center.default double
getCenterX()
Replies the center x.default double
getCenterY()
Replies the center y.default P
getClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)
Replies the closest point on this shape to the given circle.default P
getClosestPointTo(Ellipse2afp<?,?,?,?,?,?> ellipse)
Replies the closest point on this shape to the given ellipse.default P
getClosestPointTo(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Replies the closest point on this shape to the given oriented rectangle.default P
getClosestPointTo(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Replies the closest point on this shape to the given parallelogram.default P
getClosestPointTo(Path2afp<?,?,?,?,?,?> path)
Replies the closest point on this shape to the given path.default P
getClosestPointTo(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Replies the closest point on this shape to the given round rectangle.default P
getClosestPointTo(Segment2afp<?,?,?,?,?,?> segment)
Replies the closest point on this shape to the given segment.default P
getClosestPointTo(Triangle2afp<?,?,?,?,?,?> triangle)
Replies the closest point on this shape to the given triangle.default P
getClosestPointTo(Point2D<?,?> pt)
Replies the point on the shape that is closest to the given point.default double
getDistanceL1(Point2D<?,?> pt)
Computes the L-1 (Manhattan) distance between this shape and point p1.default double
getDistanceLinf(Point2D<?,?> pt)
Computes the L-infinite distance between this shape and point p1.default double
getDistanceSquared(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies the minimum distance between this shape and the given rectangle.default double
getDistanceSquared(Point2D<?,?> pt)
Replies the squared value of the minimal distance from this shape to the given point.default P
getFarthestPointTo(Point2D<?,?> pt)
Replies the point on the shape that is farthest the given point.default V
getFirstAxis()
Replies the first axis of the oriented rectangle.default double
getFirstAxisExtent()
Replies the demi-size of the rectangle along its first axis.default double
getFirstAxisX()
Replies coordinate x of the first axis of the oriented rectangle.default double
getFirstAxisY()
Replies coordinate y of the first axis of the oriented rectangle.default PathIterator2afp<IE>
getPathIterator(Transform2D transform)
Replies the elements of the paths.default V
getSecondAxis()
Replies the second axis of the oriented rectangle.default double
getSecondAxisExtent()
Replies the demi-size of the rectangle along its second axis.default double
getSecondAxisX()
Replies coordinate x of the second axis of the oriented rectangle.default double
getSecondAxisY()
Replies coordinate y of the second axis of the oriented rectangle.default boolean
intersects(Circle2afp<?,?,?,?,?,?> circle)
Replies if this shape is intersecting the given circle.default boolean
intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Replies if this shape is intersecting the given ellipse.default boolean
intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Replies if this shape is intersecting the given multishape.default boolean
intersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Replies if this shape is intersecting the given parallelogram.default boolean
intersects(PathIterator2afp<?> iterator)
Replies if this shape is intersecting the shape representing the given path iterator.default boolean
intersects(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Segment2afp<?,?,?,?,?,?> segment)
Replies if this shape is intersecting the given line.default boolean
intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Replies if this shape is intersecting the given triangle.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.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.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.default boolean
isEmpty()
Replies if this shape is empty.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.default void
set(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2Extent)
Set the oriented rectangle.default void
set(IT shape)
Set this shape with the attributes of the given shape.default void
setCenter(double cx, double cy)
Set the center.default void
setCenterX(double cx)
Set the center's x.default void
setCenterY(double cy)
Set the center's y.default void
setFirstAxis(double x, double y, double extent)
Set the first axis of the rectangle.default void
setFirstAxisExtent(double extent)
Change the demi-size of the rectangle along its first axis.default void
setFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)
Set the parallelogram from a could of points.default void
setIntersection(RectangularShape2afp<?,?,?,?,?,?> rect)
Compute the intersection of this rectangle and the given rectangle.default void
setSecondAxis(double x, double y, double extent)
Set the second axis of the rectangle.default void
setSecondAxisExtent(double extent)
Change the demi-size of the rectangle along its second axis.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.default void
toBoundingBox(B box)
Replies the bounds of the shape.default void
translate(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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if the given point is inside the rectangle; otherwisefalse
.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape2D
Replies this shape is equal to the given shape.- Specified by:
equalsToShape
in 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:
equalsToShape
in 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:
equalsToShape
in 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:
true
if this shape is equal is equal to the given path.
-
set
default void set(IT shape)
Description copied from interface:Shape2D
Set this shape with the attributes of the given shape.- Specified by:
set
in 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:
set
in 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:
set
in 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:
set
in 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:
set
in 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:Shape2D
Replies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquared
in 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:
getDistanceSquared
in 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:
getDistanceSquared
in 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:Shape2afp
Replies the minimum distance between this shape and the given rectangle.- Specified by:
getDistanceSquared
in 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:Shape2D
Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1
in 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:
getDistanceL1
in 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:
getDistanceL1
in 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:Shape2D
Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getDistanceLinf
in 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:
getDistanceLinf
in 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:
getDistanceLinf
in 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:Shape2afp
Replies if the given point is inside this shape.- Specified by:
contains
in 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:
contains
in 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:
contains
in 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:
true
if the given point is inside this shape, otherwisefalse
.
-
contains
@Pure default boolean contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afp
Replies if the given rectangle is inside this shape.- Specified by:
contains
in 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:
contains
in 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:
contains
in 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:
true
if 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
ur
is 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
ir
is 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:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given ellipse.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given circle.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given line.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given parallelogram.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
default boolean intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given triangle.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator2afp<?> iterator)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given multishape.- Specified by:
intersects
in 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:
intersects
in 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:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if 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:Shape2D
Replies the point on the shape that is closest to the given point.- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given circle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given triangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given path.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given segment.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given ellipse.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given round rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given parallelogram.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given oriented rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:
getClosestPointTo
in 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:
getClosestPointTo
in 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:Shape2D
Replies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointTo
in 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:
getFarthestPointTo
in 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:
getFarthestPointTo
in 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:Shape2D
Replies the elements of the paths.- Specified by:
getPathIterator
in 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:
getPathIterator
in 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:
getPathIterator
in 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:RectangularShape2afp
Replies the center.- Specified by:
getCenter
in 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:
getCenter
in 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:Parallelogram2afp
Set the center.- Specified by:
setCenter
in 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:Parallelogram2afp
Set the center's x.- Specified by:
setCenterX
in 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:Parallelogram2afp
Set the center's y.- Specified by:
setCenterY
in 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:Parallelogram2afp
Replies the first axis of the oriented rectangle.- Specified by:
getFirstAxis
in 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:Parallelogram2afp
Replies coordinate x of the first axis of the oriented rectangle.- Specified by:
getFirstAxisX
in 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:Parallelogram2afp
Replies coordinate y of the first axis of the oriented rectangle.- Specified by:
getFirstAxisY
in 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:Parallelogram2afp
Replies the second axis of the oriented rectangle.- Specified by:
getSecondAxis
in 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:Parallelogram2afp
Replies coordinate x of the second axis of the oriented rectangle.- Specified by:
getSecondAxisX
in 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:Parallelogram2afp
Replies coordinate y of the second axis of the oriented rectangle.- Specified by:
getSecondAxisY
in 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:Parallelogram2afp
Replies the demi-size of the rectangle along its first axis.- Specified by:
getFirstAxisExtent
in 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:Parallelogram2afp
Change the demi-size of the rectangle along its first axis.- Specified by:
setFirstAxisExtent
in 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:Parallelogram2afp
Replies the demi-size of the rectangle along its second axis.- Specified by:
getSecondAxisExtent
in 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:Parallelogram2afp
Change the demi-size of the rectangle along its second axis.- Specified by:
setSecondAxisExtent
in 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:
setFirstAxis
in 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:
setSecondAxis
in 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:Shape2D
Reset this shape to be equivalent to an just-created instance of this shape type.- Specified by:
clear
in 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:
clear
in 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:
clear
in 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:
clear
in 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:RectangularShape2afp
Replies the center x.- Specified by:
getCenterX
in 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:
getCenterX
in 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:RectangularShape2afp
Replies the center y.- Specified by:
getCenterY
in 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:
getCenterY
in 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:Shape2afp
Translate the shape.- Specified by:
translate
in 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:
translate
in 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:
translate
in 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:
translate
in 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:Shape2D
Replies the bounds of the shape.- Specified by:
toBoundingBox
in 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:
toBoundingBox
in 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:
toBoundingBox
in 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:
toBoundingBox
in 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:Shape2D
Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmpty
in 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:
isEmpty
in 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:
isEmpty
in 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:
true
if the shape is empty;false
otherwise.
-
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.INSIDE
if the first rectangle is inside the second rectangle;IntersectionType.OUTSIDE
if the first rectangle is outside the second rectangle;IntersectionType.ENCLOSING
if the first rectangle is enclosing the second rectangle;IntersectionType.ENCLOSING
if the first rectangle is the same as the second rectangle;IntersectionType.SPANNING
otherwise. - Since:
- 14.0
-
setFromPointCloud
default void setFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)
Description copied from interface:Parallelogram2afp
Set the parallelogram from a could of points.This function changes the axes to be orthogonal.
- Specified by:
setFromPointCloud
in 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:
setFromPointCloud
in 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.
-
-