Interface OrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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
,Parallelogram2afp<ST,IT,IE,P,V,B>
,Serializable
,Shape2afp<ST,IT,IE,P,V,B>
,Shape2D<ST,IT,PathIterator2afp<IE>,P,V,B>
- All Known Subinterfaces:
Rectangle2afp<ST,IT,IE,P,V,B>
- All Known Implementing Classes:
OrientedRectangle2d
,OrientedRectangle2dfx
,Rectangle2d
,Rectangle2dfx
public interface OrientedRectangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 Parallelogram2afp<ST,IT,IE,P,V,B>
Fonctional interface that represented a 2D oriented rectangle on a plane. An oriented rectangle is a parallelogram with orthogonal axes.- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Nicolas GAUD
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
OrientedRectangle2afp.AbstractOrientedRectanglePathIterator<T extends PathElement2afp>
Abstract iterator on the path elements of the oriented rectangle.static class
OrientedRectangle2afp.OrientedRectanglePathIterator<T extends PathElement2afp>
Iterator on the path elements of an oriented rectangle.static class
OrientedRectangle2afp.ProjectionToOrientedRectangleLocalCoordinateSystemPathIterator<T extends PathElement2afp>
An iterator that automatically transform and reply the path elements from the given iterator such that the coordinates of the path elements are projected in the local coordinate system of the given oriented box.static class
OrientedRectangle2afp.TransformedOrientedRectanglePathIterator<T extends PathElement2afp>
Iterator on the path elements of a transformed oriented rectangle.-
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 Abstract Methods Default Methods Modifier and Type Method Description static void
calculatesCenterPointAxisExtents(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Point2D<?,?> center, Tuple2D<?> extents)
Compute the center point and axis extents of an oriented rectangle from a set of points and the oriented rectangle axes.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
containsOrientedRectanglePoint(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double px, double py)
Replies if a point is inside in the oriented rectangle.static boolean
containsOrientedRectangleRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight)
Replies if a point is inside the oriented rectangle.default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.static void
findsClosestFarthestPointsPointOrientedRectangle(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, Point2D<?,?> closest, Point2D<?,?> farthest)
} Given a point p, this function computes the point q1 on (or in) this oriented rectangle, closest to p; and the point q2 on the oriented rectangle, farthest to p.static double
findsVectorProjectionRAxisVector(double rx, double ry, double x, double y)
Project the given vector on the R axis, assuming S axis is orthogonal.static double
findsVectorProjectionSAxisVector(double rx, double ry, double x, double y)
Project the given vector on the S axis, assuming R axis is orthogonal.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(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 PathIterator2afp<IE>
getPathIterator(Transform2D transform)
Replies the elements of the paths.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
intersectsOrientedRectangleCircle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double circleX, double circleY, double circleRadius)
Replies if the specified parallelogram intersects the specified circle.static boolean
intersectsOrientedRectangleEllipse(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double ex, double ey, double ewidth, double eheight)
Replies if the parallelogram intersects the given ellipse.static boolean
intersectsOrientedRectangleOrientedRectangle(double centerX1, double centerY1, double axis1X1, double axis1Y1, double axis1Extent1, double axis2Extent1, double centerX2, double centerY2, double axis1X2, double axis1Y2, double axis1Extent2, double axis2Extent2)
Replies if the specified rectangles intersect.static <T extends PathElement2afp>
booleanintersectsOrientedRectanglePathIterator(double centerX, double centerY, double axis1X, double axis1Y, double extent1, double extent2, PathIterator2afp<T> pathIterator)
Tests if the interior of the specifiedPathIterator2afp
intersects the interior of a specified set of oriented rectangular coordinates.static boolean
intersectsOrientedRectangleRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight)
Replies if the specified rectangles intersect.static boolean
intersectsOrientedRectangleRoundRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight, double rArcWidth, double rArcHeight)
Replies if the oriented rectangle intersects the given rectangle.static boolean
intersectsOrientedRectangleSegment(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double s1x, double s1y, double s2x, double s2y)
Replies if the specified rectangle intersects the specified segment.static boolean
intersectsOrientedRectangleTriangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double s1x, double s1y, double s2x, double s2y, double s3x, double s3y)
Replies if the specified rectangle intersects the specified triangle.default void
rotate(double angle)
Roate the parallelogram around its center.void
set(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent)
Set the oriented rectangle.default void
set(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2x, double axis2y, double axis2Extent)
Set the oriented rectangle.default void
set(IT rectangle)
Set this shape with the attributes of the given shape.default void
set(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, double axis2Extent)
Set the oriented rectangle.default void
setFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)
Set the parallelogram from a could of points.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.Parallelogram2afp
getCenter, getCenterX, getCenterY, getFirstAxis, getFirstAxisExtent, getFirstAxisX, getFirstAxisY, getSecondAxis, getSecondAxisExtent, getSecondAxisX, getSecondAxisY, isCCW, isEmpty, set, setCenter, setCenter, setCenterX, setCenterY, setFirstAxis, setFirstAxis, setFirstAxis, setFirstAxis, setFirstAxisExtent, setFromPointCloud, setSecondAxis, setSecondAxis, setSecondAxis, setSecondAxis, setSecondAxisExtent
-
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, 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
-
findsVectorProjectionRAxisVector
@Pure static double findsVectorProjectionRAxisVector(double rx, double ry, double x, double y)
Project the given vector on the R axis, assuming S axis is orthogonal.This function assumes that axes are orthogonal. For a general projection on the R axis, see
Parallelogram2afp.findsVectorProjectionRAxisPoint(double, double, double, double, double, double)
.- Parameters:
rx
- the x coordinate of the R axis.ry
- the y coordinate of the R axis.x
- the x coordinate of the vector.y
- the y coordinate of the vector.- Returns:
- the coordinate of the projection of the vector on R
- See Also:
Parallelogram2afp.findsVectorProjectionRAxisPoint(double, double, double, double, double, double)
-
findsVectorProjectionSAxisVector
@Pure static double findsVectorProjectionSAxisVector(double rx, double ry, double x, double y)
Project the given vector on the S axis, assuming R axis is orthogonal.This function assumes that axes are orthogonal. For a general projection on the S axis, see
Parallelogram2afp.findsVectorProjectionSAxisVector(double, double, double, double, double, double)
.- Parameters:
rx
- the x coordinate of the R axis (NOT the S axis).ry
- the y coordinate of the R axis (NOT the S axis).x
- the x coordinate of the vector.y
- the y coordinate of the vector.- Returns:
- the coordinate of the projection of the vector on S
- See Also:
Parallelogram2afp.findsVectorProjectionSAxisVector(double, double, double, double, double, double)
-
calculatesCenterPointAxisExtents
static void calculatesCenterPointAxisExtents(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Point2D<?,?> center, Tuple2D<?> extents)
Compute the center point and axis extents of an oriented rectangle from a set of points and the oriented rectangle axes.This function assumes orthogonal axes, in opposite to
Parallelogram2afp.calculatesCenterPointAxisExtents(Iterable, Vector2D, Vector2D, Point2D, Tuple2D)
, which assumes not constraint on the axes.- Parameters:
points
- is the list of the points enclosed by the oriented rectangle.raxis
- is the R axis of the oriented rectangle.center
- is the point which is set with the parallogram's center coordinates.extents
- are the extents of the parallogram for the R and S axis.- See Also:
- "MGPCG pages 222-223 (oriented bounding box)",
Parallelogram2afp.calculatesCenterPointAxisExtents(Iterable, Vector2D, Vector2D, Point2D, Tuple2D)
-
containsOrientedRectanglePoint
@Pure static boolean containsOrientedRectanglePoint(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double px, double py)
Replies if a point is inside in the oriented rectangle.- Parameters:
px
- is the X coordinate of the point to test.py
- is the Y coordinate of the point to test.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 the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.- Returns:
true
if the given point is inside the oriented rectangle; otherwisefalse
.
-
containsOrientedRectangleRectangle
@Pure static boolean containsOrientedRectangleRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight)
Replies if a point is inside the oriented rectangle.- 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 the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.rx
- is the X coordinate of the lower point of the rectangle.ry
- is the Y coordinate of the lower point of the rectangle.rwidth
- is the width of the rectangle.rheight
- is the height of the rectangle.- Returns:
true
if the given rectangle is inside the oriented rectangle; otherwisefalse
.
-
findsClosestFarthestPointsPointOrientedRectangle
static void findsClosestFarthestPointsPointOrientedRectangle(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, Point2D<?,?> closest, Point2D<?,?> farthest)
} Given a point p, this function computes the point q1 on (or in) this oriented rectangle, closest to p; and the point q2 on the oriented rectangle, farthest to p. If there are several points, the function will return one of those. Remember this function may return an approximate result when points remain on oriented rectangle plane of symmetry.- Parameters:
px
- is the X coordinate of the point to test.py
- is the Y coordinate of the point to test.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 the axis 1 vector.axis1Y
- is the Y coordinate of the axis 1 vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.closest
- the closest point. Ifnull
, the closest point is not computed.farthest
- the farthest point. Ifnull
, the farthest point is not computed.
-
intersectsOrientedRectangleSegment
@Pure static boolean intersectsOrientedRectangleSegment(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double s1x, double s1y, double s2x, double s2y)
Replies if the specified rectangle intersects the specified segment.- 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 the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.s1x
- is the X coordinate of the first point of the segment.s1y
- is the Y coordinate of the first point of the segment.s2x
- is the X coordinate of the second point of the segment.s2y
- is the Y coordinate of the second point of the segment.- Returns:
true
if intersecting, otherwisefalse
-
intersectsOrientedRectangleTriangle
@Pure static boolean intersectsOrientedRectangleTriangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double s1x, double s1y, double s2x, double s2y, double s3x, double s3y)
Replies if the specified rectangle intersects the specified triangle.- 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 the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.s1x
- is the X coordinate of the first point of the triangle.s1y
- is the Y coordinate of the first point of the triangle.s2x
- is the X coordinate of the second point of the triangle.s2y
- is the Y coordinate of the second point of the triangle.s3x
- is the X coordinate of the third point of the triangle.s3y
- is the Y coordinate of the third point of the triangle.- Returns:
true
if intersecting, otherwisefalse
-
intersectsOrientedRectangleEllipse
@Pure static boolean intersectsOrientedRectangleEllipse(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double ex, double ey, double ewidth, double eheight)
Replies if the parallelogram intersects the given ellipse.- Parameters:
centerX
- is the X coordinate of the parallelogram center.centerY
- is the Y coordinate of the parallelogram center.axis1X
- is the X coordinate of the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the parallelogram.axis2Extent
- is the extent of the axis 2 of the parallelogram.ex
- is the coordinate of the min point of the ellipse rectangle.ey
- is the coordinate of the min point of the ellipse rectangle.ewidth
- is the width of the ellipse.eheight
- is the height of the ellipse.- Returns:
true
if intersecting, otherwisefalse
-
intersectsOrientedRectangleCircle
@Pure static boolean intersectsOrientedRectangleCircle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double circleX, double circleY, double circleRadius)
Replies if the specified parallelogram intersects the specified circle.- Parameters:
centerX
- is the X coordinate of the parallelogram center.centerY
- is the Y coordinate of the parallelogram center.axis1X
- is the X coordinate of the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the parallelogram.axis2Extent
- is the extent of the axis 2 of the parallelogram.circleX
- is the coordinate of the circle center.circleY
- is the coordinate of the circle center.circleRadius
- is the radius of the circle.- Returns:
true
if intersecting, otherwisefalse
-
intersectsOrientedRectangleOrientedRectangle
@Pure static boolean intersectsOrientedRectangleOrientedRectangle(double centerX1, double centerY1, double axis1X1, double axis1Y1, double axis1Extent1, double axis2Extent1, double centerX2, double centerY2, double axis1X2, double axis1Y2, double axis1Extent2, double axis2Extent2)
Replies if the specified rectangles intersect.The extents are assumed to be positive or zero. The lengths of the given arrays are assumed to be
2
.This function uses the "separating axis theorem" which states that for any two oriented rectangles (AABB is a special case of oriented rectangle) that do not touch, a separating axis can be found.
This function uses an general intersection test between two oriented rectangle. If the first box is expected to be an MBR, please use the optimized algorithm given by
intersectsOrientedRectangleRectangle(double, double, double, double, double, double, double, double, double, double)
.- Parameters:
centerX1
- is the X coordinate of the oriented rectangle center.centerY1
- is the Y coordinate of the oriented rectangle center.axis1X1
- is the X coordinate of the axis 1 unit vector.axis1Y1
- is the Y coordinate of the axis 1 unit vector.axis1Extent1
- is the extent of the axis 1 of the oriented rectangle.axis2Extent1
- is the extent of the axis 2 of the oriented rectangle.centerX2
- is the X coordinate of the oriented rectangle center.centerY2
- is the Y coordinate of the oriented rectangle center.axis1X2
- is the X coordinate of the axis 1 unit vector.axis1Y2
- is the Y coordinate of the axis 1 unit vector.axis1Extent2
- is the extent of the axis 1 of the oriented rectangle.axis2Extent2
- is the extent of the axis 2 of the oriented rectangle.- Returns:
true
if intersecting, otherwisefalse
- See Also:
- "RTCD pages 102-105", Intersection between two oriented boudning rectangles
-
intersectsOrientedRectangleRectangle
@Pure static boolean intersectsOrientedRectangleRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight)
Replies if the specified rectangles intersect.This function is assuming that
lx1
is lower or equal toux1
, andly1
is lower or equal touy1
. The extents are assumed to be positive or zero. The lengths of the given arrays are assumed to be2
.This function uses the "separating axis theorem" which states that for any two oriented rectangles (AABB is a special case of oriented rectangle) that do not touch, a separating axis can be found.
This function uses an optimized algorithm for AABB as first parameter. The general intersection type between two oriented rectangle is given by
intersectsOrientedRectangleOrientedRectangle(double, double, double, double, double, double, double, double, double, double, double, double)
.- 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 the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the oriented rectangle.axis2Extent
- is the extent of the axis 2 of the oriented rectangle.rx
- is the X coordinate of the lower point of the rectangle.ry
- is the Y coordinate of the lower point of the rectangle.rwidth
- is the width of the rectangle.rheight
- is the height of the rectangle.- Returns:
true
if intersecting, otherwisefalse
- See Also:
- "RTCD pages 102-105", OBB collision detection on Gamasutra.com
-
intersectsOrientedRectangleRoundRectangle
@Pure static boolean intersectsOrientedRectangleRoundRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent, double rx, double ry, double rwidth, double rheight, double rArcWidth, double rArcHeight)
Replies if the oriented rectangle intersects the given rectangle.- Parameters:
centerX
- is the X coordinate of the parallelogram center.centerY
- is the Y coordinate of the parallelogram center.axis1X
- is the X coordinate of the axis 1 unit vector.axis1Y
- is the Y coordinate of the axis 1 unit vector.axis1Extent
- is the extent of the axis 1 of the parallelogram.axis2Extent
- is the extent of the axis 2 of the parallelogram.rx
- is the X coordinate of the lower point of the rectangle.ry
- is the Y coordinate of the lower point of the rectangle.rwidth
- is the width of the rectangle.rheight
- is the height of the rectangle.rArcWidth
- is the width of the rectangle arcs.rArcHeight
- is the height of the rectangle arcs.- Returns:
true
if intersecting, otherwisefalse
.
-
intersectsOrientedRectanglePathIterator
static <T extends PathElement2afp> boolean intersectsOrientedRectanglePathIterator(double centerX, double centerY, double axis1X, double axis1Y, double extent1, double extent2, PathIterator2afp<T> pathIterator)
Tests if the interior of the specifiedPathIterator2afp
intersects the interior of a specified set of oriented rectangular coordinates.- Type Parameters:
T
- the type of the path elements to iterate on.- Parameters:
centerX
- the specified X coordinate of the rectangle center.centerY
- the specified Y coordinate of the rectangle center.axis1X
- the X coordinate of the first axis of the rectangle.axis1Y
- the Y coordinate of the first axis of the rectangle.extent1
- the extent the rectangle along the first axis.extent2
- the extent the rectangle along the second axis.pathIterator
- the specifiedPathIterator2afp
.- Returns:
true
if the specifiedPathIterator2afp
and the interior of the specified set of rectangular coordinates intersect each other;false
otherwise.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>
-
set
default void set(IT rectangle)
Description copied from interface:Shape2D
Set this shape with the attributes of the given shape.- Specified by:
set
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 shape to copy.
-
set
default void set(double centerX, double centerY, double axis1x, double axis1y, double axis1Extent, double axis2x, double axis2y, double axis2Extent)
Set the oriented rectangle.For an oriented rectangle, the coordinates of the second axis are ignored. Indeed, they are automatically computed for being orthogonal to the first axis.
- Specified by:
set
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OBR center.centerY
- is the Y coordinate of the OBR center.axis1x
- is the X coordinate of first axis of the OBR.axis1y
- is the Y coordinate of first axis of the OBR.axis1Extent
- is the extent of the first axis.axis2x
- is the X coordinate of second axis of the OBR.axis2y
- is the Y coordinate of second axis of the OBR.axis2Extent
- is the extent of the second axis.
-
set
default void set(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, double axis2Extent)
Set the oriented rectangle. The second axis is automatically computed.- Parameters:
center
- is the oriented rectangle center.axis1
- is the first axis of the oriented rectangle.axis1Extent
- is the extent of the first axis.axis2Extent
- is the extent of the second axis.
-
set
void set(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2Extent)
Set the oriented rectangle. The second axis is automatically computed.- 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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
translate
default void translate(double dx, double dy)
Description copied from interface:Shape2afp
Translate the shape.- Specified by:
translate
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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
.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given ellipse.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given line.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given triangle.- Specified by:
intersects
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
getPathIterator
@Pure default PathIterator2afp<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2D
Replies the elements of the paths.- Specified by:
getPathIterator
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
toBoundingBox
@Pure default void toBoundingBox(B box)
Description copied from interface:Shape2D
Replies the bounds of the shape.- Specified by:
toBoundingBox
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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(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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
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 interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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 OrientedRectangle2afp<?,?,IE,P,V,B>,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.
-
rotate
default void rotate(double angle)
Description copied from interface:Parallelogram2afp
Roate the parallelogram around its center.- Specified by:
rotate
in interfaceParallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends OrientedRectangle2afp<?,?,IE,P,V,B>,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:
angle
- the angle of rotation.
-
-