Interface Parallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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,Serializable,Shape2afp<ST,IT,IE,P,V,B>,Shape2D<ST,IT,PathIterator2afp<IE>,P,V,B>
- All Known Subinterfaces:
OrientedRectangle2afp<ST,IT,IE,P,V,B>,Rectangle2afp<ST,IT,IE,P,V,B>
- All Known Implementing Classes:
OrientedRectangle2d,OrientedRectangle2dfx,Parallelogram2d,Parallelogram2dfx,Rectangle2d,Rectangle2dfx
public interface Parallelogram2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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 Shape2afp<ST,IT,IE,P,V,B>
Fonctional interface that represented a 2D parallelogram on a plane.- 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 classParallelogram2afp.AbstractParallelogramPathIterator<T extends PathElement2afp>Abstract iterator on the path elements of the parallelogram.static classParallelogram2afp.ParallelogramPathIterator<T extends PathElement2afp>Iterator on the path elements of a parallelogram.static classParallelogram2afp.ProjectionToParallelogramLocalCoordinateSystemPathIterator<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 parallelogram.static classParallelogram2afp.TransformedParallelogramPathIterator<T extends PathElement2afp>Iterator on the path elements of a transformed oriented rectangle.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static voidcalculatesCenterPointAxisExtents(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Vector2D<?,?> saxis, Point2D<?,?> center, Tuple2D<?> extents)Compute the center point and axis extents of a parallelogram from a set of points and the parallelogram axes.static voidcalculatesOrthogonalAxes(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Vector2D<?,?> saxis)Compute the axes of an oriented bounding rectangle that is enclosing the set of points.default voidclear()Reset this shape to be equivalent to an just-created instance of this shape type.default booleancontains(double x, double y)Replies if the given point is inside this shape.default booleancontains(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies if the given rectangle is inside this shape.static booleancontainsParallelogramPoint(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double px, double py)Replies if a point is inside in the parallelogram.static booleancontainsParallelogramRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)Replies if a rectangle is inside the parallelogram.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.static voidfindsClosestPointPointParallelogram(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,?> closest)Given a point p, this function computes the point q1 on (or in) this parallelogram, closest to p; and the point q2 on the parallelogram, farthest to p.static voidfindsFarthestPointPointParallelogram(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,?> farthest)Given a point p, this function computes the point q2 on the parallelogram, farthest to p.static doublefindsVectorProjectionRAxisPoint(double rx, double ry, double sx, double sy, double x, double y)Project the given vector on the R (first) axis, according to the direction of the S (second) axis.static doublefindsVectorProjectionSAxisVector(double rx, double ry, double sx, double sy, double x, double y)Project the given vector on the S (second) axis, according to the direction of the R (first) axis.PgetCenter()Replies the center.doublegetCenterX()Replies the center x.doublegetCenterY()Replies the center y.default PgetClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)Replies the closest point on this shape to the given circle.default PgetClosestPointTo(Ellipse2afp<?,?,?,?,?,?> ellipse)Replies the closest point on this shape to the given ellipse.default PgetClosestPointTo(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)Replies the closest point on this shape to the given oriented rectangle.default PgetClosestPointTo(Parallelogram2afp<?,?,?,?,?,?> parallelogram)Replies the closest point on this shape to the given parallelogram.default PgetClosestPointTo(Path2afp<?,?,?,?,?,?> path)Replies the closest point on this shape to the given path.default PgetClosestPointTo(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies the closest point on this shape to the given rectangle.default PgetClosestPointTo(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)Replies the closest point on this shape to the given round rectangle.default PgetClosestPointTo(Segment2afp<?,?,?,?,?,?> segment)Replies the closest point on this shape to the given segment.default PgetClosestPointTo(Triangle2afp<?,?,?,?,?,?> triangle)Replies the closest point on this shape to the given triangle.default PgetClosestPointTo(Point2D<?,?> pt)Replies the point on the shape that is closest to the given point.default doublegetDistanceL1(Point2D<?,?> pt)Computes the L-1 (Manhattan) distance between this shape and point p1.default doublegetDistanceLinf(Point2D<?,?> pt)Computes the L-infinite distance between this shape and point p1.default doublegetDistanceSquared(Point2D<?,?> pt)Replies the squared value of the minimal distance from this shape to the given point.default PgetFarthestPointTo(Point2D<?,?> pt)Replies the point on the shape that is farthest the given point.VgetFirstAxis()Replies the first axis of the oriented rectangle.doublegetFirstAxisExtent()Replies the demi-size of the rectangle along its first axis.doublegetFirstAxisX()Replies coordinate x of the first axis of the oriented rectangle.doublegetFirstAxisY()Replies coordinate y of the first axis of the oriented rectangle.default PathIterator2afp<IE>getPathIterator(Transform2D transform)Replies the elements of the paths.VgetSecondAxis()Replies the second axis of the oriented rectangle.doublegetSecondAxisExtent()Replies the demi-size of the rectangle along its second axis.doublegetSecondAxisX()Replies coordinate x of the second axis of the oriented rectangle.doublegetSecondAxisY()Replies coordinate y of the second axis of the oriented rectangle.default booleanintersects(Circle2afp<?,?,?,?,?,?> circle)Replies if this shape is intersecting the given circle.default booleanintersects(Ellipse2afp<?,?,?,?,?,?> ellipse)Replies if this shape is intersecting the given ellipse.default booleanintersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)Replies if this shape is intersecting the given multishape.default booleanintersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)Replies if this shape is intersecting the given parallelogram.default booleanintersects(PathIterator2afp<?> iterator)Replies if this shape is intersecting the shape representing the given path iterator.default booleanintersects(Rectangle2afp<?,?,?,?,?,?> rectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)Replies if this shape is intersecting the given rectangle.default booleanintersects(Segment2afp<?,?,?,?,?,?> segment)Replies if this shape is intersecting the given line.default booleanintersects(Triangle2afp<?,?,?,?,?,?> triangle)Replies if this shape is intersecting the given triangle.static booleanintersectsParallelogramCircle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double circleX, double circleY, double circleRadius)Replies if the specified parallelogram intersects the specified circle.static booleanintersectsParallelogramEllipse(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double ex, double ey, double ewidth, double eheight)Replies if the parallelogram intersects the given ellipse.static booleanintersectsParallelogramParallelogram(double centerX1, double centerY1, double axis1X1, double axis1Y1, double axis1Extent1, double axis2X1, double axis2Y1, double axis2Extent1, double centerX2, double centerY2, double axis1X2, double axis1Y2, double axis1Extent2, double axis2X2, double axis2Y2, double axis2Extent2)Replies if two parallelograms intersect.static <T extends PathElement2afp>
booleanintersectsParallelogramPathIterator(double centerX, double centerY, double axis1X, double axis1Y, double extent1, double axis2X, double axis2Y, double extent2, PathIterator2afp<T> pathIterator)Tests if the interior of the specifiedPathIterator2afpintersects the interior of a specified set of oriented rectangular coordinates.static booleanintersectsParallelogramRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)Replies if the parallelogram intersects the given rectangle.static booleanintersectsParallelogramRoundRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight, double rArcWidth, double rArcHeight)Replies if the parallelogram intersects the given rectangle.static booleanintersectsParallelogramSegment(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double s1x, double s1y, double s2x, double s2y)Replies if the specified parallelogram intersects the specified segment.static booleanintersectsParallelogramTriangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double tx1, double ty1, double tx2, double ty2, double tx3, double ty3)Replies if the specified parallelogram intersects the specified triangle.default booleanisCCW()Replies if the axes of the parallelogram are defined in a counter-clockwise order.default booleanisEmpty()Replies if this shape is empty.default voidrotate(double angle)Roate the parallelogram around its center.voidset(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent)Set the oriented rectangle.default voidset(IT parallelogram)Set this shape with the attributes of the given shape.default voidset(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, Vector2D<?,?> axis2, double axis2Extent)Set the parallelogram.voidsetCenter(double cx, double cy)Set the center.default voidsetCenter(Point2D<?,?> center)Set the center.voidsetCenterX(double cx)Set the center's x.voidsetCenterY(double cy)Set the center's y.default voidsetFirstAxis(double x, double y)Set the first axis of the rectangle.voidsetFirstAxis(double x, double y, double extent)Set the first axis of the rectangle.default voidsetFirstAxis(Vector2D<?,?> axis)Set the first axis of the rectangle.default voidsetFirstAxis(Vector2D<?,?> axis, double extent)Set the first axis of the rectangle.voidsetFirstAxisExtent(double extent)Change the demi-size of the rectangle along its first axis.default voidsetFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)Set the parallelogram from a could of points.default voidsetFromPointCloud(Point2D<?,?>... pointCloud)Set the oriented rectangle from a could of points.default voidsetSecondAxis(double x, double y)Set the second axis of the rectangle.voidsetSecondAxis(double x, double y, double extent)Set the second axis of the rectangle.default voidsetSecondAxis(Vector2D<?,?> axis)Set the second axis of the rectangle.default voidsetSecondAxis(Vector2D<?,?> axis, double extent)Set the second axis of the rectangle.voidsetSecondAxisExtent(double extent)Change the demi-size of the rectangle along its second axis.default voidtoBoundingBox(B box)Replies the bounds of the shape.default voidtranslate(double dx, double dy)Translate the shape.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.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
-
calculatesOrthogonalAxes
static void calculatesOrthogonalAxes(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Vector2D<?,?> saxis)
Compute the axes of an oriented bounding rectangle that is enclosing the set of points.- Parameters:
points- is the list of the points enclosed by the OBR.raxis- is the vector where the R axis of the OBR is put. Ifnull, S must be notnull.saxis- is the vector where the S axis of the OBR is put. Ifnull, R must be notnull.- See Also:
- "MGPCG pages 219-221"
-
findsVectorProjectionRAxisPoint
@Pure static double findsVectorProjectionRAxisPoint(double rx, double ry, double sx, double sy, double x, double y)Project the given vector on the R (first) axis, according to the direction of the S (second) axis.This function assumes nothing on the axes' orientations. For an efficient implementation for orthogonal axes, see
OrientedRectangle2afp.findsVectorProjectionRAxisVector(double, double, double, double).- Parameters:
rx- the x coordinate of the R axis.ry- the y coordinate of the R axis.sx- the x coordinate of the S axis.sy- the y coordinate of 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 R
- See Also:
OrientedRectangle2afp.findsVectorProjectionRAxisVector(double, double, double, double)
-
findsVectorProjectionSAxisVector
@Pure static double findsVectorProjectionSAxisVector(double rx, double ry, double sx, double sy, double x, double y)Project the given vector on the S (second) axis, according to the direction of the R (first) axis.This function assumes nothing on the axes' orientations. For an efficient implementation for orthogonal axes, see
OrientedRectangle2afp.findsVectorProjectionSAxisVector(double, double, double, double).- Parameters:
rx- the x coordinate of the R axis.ry- the y coordinate of the R axis.sx- the x coordinate of the S axis.sy- the y coordinate of 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:
OrientedRectangle2afp.findsVectorProjectionSAxisVector(double, double, double, double)
-
calculatesCenterPointAxisExtents
static void calculatesCenterPointAxisExtents(Iterable<? extends Point2D<?,?>> points, Vector2D<?,?> raxis, Vector2D<?,?> saxis, Point2D<?,?> center, Tuple2D<?> extents)
Compute the center point and axis extents of a parallelogram from a set of points and the parallelogram axes.This function assumes no constraint on the axes' orientations, in opposite to
OrientedRectangle2afp.calculatesCenterPointAxisExtents(Iterable, Vector2D, Point2D, Tuple2D), which assumes orthogonal axes.- Parameters:
points- is the list of the points enclosed by the parallogramraxis- is the R axis of the parallogramsaxis- is the S axis of the parallogramcenter- 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)",
OrientedRectangle2afp.calculatesCenterPointAxisExtents(Iterable, Vector2D, Point2D, Tuple2D)
-
findsClosestPointPointParallelogram
static void findsClosestPointPointParallelogram(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,?> closest)Given a point p, this function computes the point q1 on (or in) this parallelogram, closest to p; and the point q2 on the parallelogram, 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 parallelogram 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 parallelogram center.centerY- is the Y coordinate of the parallelogram 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 parallelogram.axis2X- is the X coordinate of the axis 2 vector.axis2Y- is the Y coordinate of the axis 2 vector.axis2Extent- is the extent of the axis 2 of the parallelogram.closest- the closest point.
-
findsFarthestPointPointParallelogram
static void findsFarthestPointPointParallelogram(double px, double py, double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, Point2D<?,?> farthest)Given a point p, this function computes the point q2 on the parallelogram, 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 parallelogram 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 parallelogram center.centerY- is the Y coordinate of the parallelogram 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 parallelogram.axis2X- is the X coordinate of the axis 2 vector.axis2Y- is the Y coordinate of the axis 2 vector.axis2Extent- is the extent of the axis 2 of the parallelogram.farthest- the farthest point.
-
containsParallelogramPoint
@Pure static boolean containsParallelogramPoint(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double px, double py)Replies if a point is inside in the parallelogram.- 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 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.axis2Extent- is the extent of the axis 2 of the parallelogram.- Returns:
trueif the given point is inside the parallelogram; otherwisefalse.
-
containsParallelogramRectangle
@Pure static boolean containsParallelogramRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)Replies if a rectangle is inside the parallelogram.- 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.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.- Returns:
trueif the given rectangle is inside the parallelogram; otherwisefalse.
-
intersectsParallelogramSegment
@Pure static boolean intersectsParallelogramSegment(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double s1x, double s1y, double s2x, double s2y)Replies if the specified parallelogram intersects the specified segment.- 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.axis2Extent- is the extent of the axis 2 of the OBB.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:
trueif intersecting, otherwisefalse
-
intersectsParallelogramTriangle
@Pure static boolean intersectsParallelogramTriangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double tx1, double ty1, double tx2, double ty2, double tx3, double ty3)Replies if the specified parallelogram intersects the specified triangle.- 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.axis2Extent- is the extent of the axis 2 of the OBB.tx1- is the X coordinate of the first point of the triangle.ty1- is the Y coordinate of the first point of the triangle.tx2- is the X coordinate of the second point of the triangle.ty2- is the Y coordinate of the second point of the triangle.tx3- is the X coordinate of the third point of the triangle.ty3- is the Y coordinate of the third point of the triangle.- Returns:
trueif intersecting, otherwisefalse
-
intersectsParallelogramCircle
@Pure static boolean intersectsParallelogramCircle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.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:
trueif intersecting, otherwisefalse
-
intersectsParallelogramEllipse
@Pure static boolean intersectsParallelogramEllipse(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.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:
trueif intersecting, otherwisefalse
-
intersectsParallelogramRectangle
@Pure static boolean intersectsParallelogramRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight)Replies if the parallelogram 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.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.- Returns:
trueif intersecting, otherwisefalse.
-
intersectsParallelogramParallelogram
@Pure static boolean intersectsParallelogramParallelogram(double centerX1, double centerY1, double axis1X1, double axis1Y1, double axis1Extent1, double axis2X1, double axis2Y1, double axis2Extent1, double centerX2, double centerY2, double axis1X2, double axis1Y2, double axis1Extent2, double axis2X2, double axis2Y2, double axis2Extent2)Replies if two parallelograms intersect.- Parameters:
centerX1- is the X coordinate of the first parallelogram center.centerY1- is the Y coordinate of the first parallelogram 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 first parallelogram.axis2X1- is the X coordinate of the axis 2 unit vector.axis2Y1- is the Y coordinate of the axis 2 unit vector.axis2Extent1- is the extent of the axis 2 of the first parallelogram.centerX2- is the X coordinate of the second parallelogram center.centerY2- is the Y coordinate of the second parallelogram 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 second parallelogram.axis2X2- is the X coordinate of the axis 2 unit vector.axis2Y2- is the Y coordinate of the axis 2 unit vector.axis2Extent2- is the extent of the axis 2 of the second parallelogram.- Returns:
trueif intersecting, otherwisefalse.
-
intersectsParallelogramRoundRectangle
@Pure static boolean intersectsParallelogramRoundRectangle(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent, double rx, double ry, double rwidth, double rheight, double rArcWidth, double rArcHeight)Replies if the parallelogram 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.axis2X- is the X coordinate of the axis 2 unit vector.axis2Y- is the Y coordinate of the axis 2 unit vector.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:
trueif intersecting, otherwisefalse.
-
intersectsParallelogramPathIterator
static <T extends PathElement2afp> boolean intersectsParallelogramPathIterator(double centerX, double centerY, double axis1X, double axis1Y, double extent1, double axis2X, double axis2Y, double extent2, PathIterator2afp<T> pathIterator)
Tests if the interior of the specifiedPathIterator2afpintersects 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 parallelogram.axis1Y- the Y coordinate of the first axis of the parallelogram.extent1- the extent the rectangle along the first axis.axis2X- the X coordinate of the second axis of the parallelogram.axis2Y- the Y coordinate of the second axis of the parallelogram.extent2- the extent the rectangle along the second axis.pathIterator- the specifiedPathIterator2afp.- Returns:
trueif the specifiedPathIterator2afpand the interior of the specified set of rectangular coordinates intersect each other;falseotherwise.
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape2DReplies this shape is equal to the given shape.- Specified by:
equalsToShapein interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
shape- the shape to compare to.- Returns:
trueif this shape is equal is equal to the given path.
-
getCenter
@Pure P getCenter()
Replies the center.- Returns:
- the center.
-
getCenterX
@Pure double getCenterX()
Replies the center x.- Returns:
- the center x.
-
getCenterY
@Pure double getCenterY()
Replies the center y.- Returns:
- the center y.
-
setCenter
void setCenter(double cx, double cy)Set the center.- Parameters:
cx- the center x.cy- the center y.
-
setCenter
default void setCenter(Point2D<?,?> center)
Set the center.- Parameters:
center- the center point.
-
setCenterX
void setCenterX(double cx)
Set the center's x.- Parameters:
cx- the center x.
-
setCenterY
void setCenterY(double cy)
Set the center's y.- Parameters:
cy- the center y.
-
getFirstAxis
@Pure V getFirstAxis()
Replies the first axis of the oriented rectangle.- Returns:
- the unit vector of the first axis.
-
getFirstAxisX
@Pure double getFirstAxisX()
Replies coordinate x of the first axis of the oriented rectangle.- Returns:
- the coordinate x of the unit vector of the first axis.
-
getFirstAxisY
@Pure double getFirstAxisY()
Replies coordinate y of the first axis of the oriented rectangle.- Returns:
- the coordinate y of the unit vector of the first axis.
-
getSecondAxis
@Pure V getSecondAxis()
Replies the second axis of the oriented rectangle.- Returns:
- the unit vector of the second axis.
-
getSecondAxisX
@Pure double getSecondAxisX()
Replies coordinate x of the second axis of the oriented rectangle.- Returns:
- the coordinate x of the unit vector of the second axis.
-
getSecondAxisY
@Pure double getSecondAxisY()
Replies coordinate y of the second axis of the oriented rectangle.- Returns:
- the coordinate y of the unit vector of the second axis.
-
getFirstAxisExtent
@Pure double getFirstAxisExtent()
Replies the demi-size of the rectangle along its first axis.- Returns:
- the extent along the first axis.
-
setFirstAxisExtent
void setFirstAxisExtent(double extent)
Change the demi-size of the rectangle along its first axis.- Parameters:
extent- - the extent along the first axis.
-
getSecondAxisExtent
@Pure double getSecondAxisExtent()
Replies the demi-size of the rectangle along its second axis.- Returns:
- the extent along the second axis.
-
setSecondAxisExtent
void setSecondAxisExtent(double extent)
Change the demi-size of the rectangle along its second axis.- Parameters:
extent- - the extent along the second axis.
-
setFirstAxis
default void setFirstAxis(Vector2D<?,?> axis)
Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.- Parameters:
axis- - the new values for the first axis.
-
setFirstAxis
default void setFirstAxis(Vector2D<?,?> axis, double extent)
Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.- Parameters:
axis- - the new values for the first axis.extent- - the extent of the axis.
-
setFirstAxis
default void setFirstAxis(double x, double y)Set the first axis of the rectangle. The second axis is updated to be perpendicular to the new first axis.- Parameters:
x- x coordinate of the first axis.y- y coordinate of the first axis.
-
setFirstAxis
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.- 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(Vector2D<?,?> axis)
Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.- Parameters:
axis- - the new values for the first axis.
-
setSecondAxis
default void setSecondAxis(Vector2D<?,?> axis, double extent)
Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.- Parameters:
axis- - the new values for the first axis.extent- - the extent of the axis.
-
setSecondAxis
default void setSecondAxis(double x, double y)Set the second axis of the rectangle. The first axis is updated to be perpendicular to the new second axis.- Parameters:
x- - the new values for the first axis.y- - the new values for the first axis.
-
setSecondAxis
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.- 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.
-
isEmpty
@Pure default boolean isEmpty()
Description copied from interface:Shape2DReplies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmptyin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Returns:
trueif the shape is empty;falseotherwise.
-
clear
default void clear()
Description copied from interface:Shape2DReset this shape to be equivalent to an just-created instance of this shape type.
-
set
default void set(IT parallelogram)
Description copied from interface:Shape2DSet this shape with the attributes of the given shape.- Specified by:
setin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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 shape to copy.
-
set
default void set(Point2D<?,?> center, Vector2D<?,?> axis1, double axis1Extent, Vector2D<?,?> axis2, double axis2Extent)
Set the parallelogram.- Parameters:
center- is the parallelogram center.axis1- is the first axis of the parallelogram.axis1Extent- is the extent of the first axis.axis2- is the second axis of the parallelogram.axis2Extent- is the extent of the second axis.
-
set
void set(double centerX, double centerY, double axis1X, double axis1Y, double axis1Extent, double axis2X, double axis2Y, double axis2Extent)Set the oriented rectangle.- 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.
-
setFromPointCloud
default void setFromPointCloud(Iterable<? extends Point2D<?,?>> pointCloud)
Set the parallelogram from a could of points.This function changes the axes to be orthogonal.
- Parameters:
pointCloud- - the cloud of points.- Since:
- 14.0
-
setFromPointCloud
default void setFromPointCloud(Point2D<?,?>... pointCloud)
Set the oriented rectangle from a could of points.- Parameters:
pointCloud- - the cloud of points.- Since:
- 14.0
-
getDistanceSquared
@Pure default double getDistanceSquared(Point2D<?,?> pt)
Description copied from interface:Shape2DReplies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquaredin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2DComputes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1in interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
pt- the point- Returns:
- the distance.
-
getDistanceLinf
@Pure default double getDistanceLinf(Point2D<?,?> pt)
Description copied from interface:Shape2DComputes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getDistanceLinfin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpTranslate the shape.- Specified by:
translatein interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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.
-
rotate
default void rotate(double angle)
Roate the parallelogram around its center.- Parameters:
angle- the angle of rotation.
-
contains
@Pure default boolean contains(double x, double y)Description copied from interface:Shape2afpReplies if the given point is inside this shape.- Specified by:
containsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
x- x coordinate of the point to test.y- y coordinate of the point to test.- Returns:
trueif the given point is inside this shape, otherwisefalse.
-
contains
@Pure default boolean contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies if the given rectangle is inside this shape.- Specified by:
containsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
trueif the given rectangle is inside this shape, otherwisefalse.
-
intersects
@Pure default boolean intersects(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given circle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
circle- the circle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given ellipse.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
ellipse- the ellipse.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
orientedRectangle- the oriented rectangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given parallelogram.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
parallelogram- the parallelogram.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given rectangle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
roundRectangle- the round rectangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given line.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
segment- the segment.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given triangle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
triangle- the triangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given multishape.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
multishape- the multishape.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator2afp<?> iterator)
Description copied from interface:Shape2afpReplies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
iterator- the path iterator.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
getPathIterator
@Pure default PathIterator2afp<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2DReplies the elements of the paths.- Specified by:
getPathIteratorin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2DReplies the point on the shape that is closest to the given point.- Specified by:
getClosestPointToin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afpReplies the closest point on this shape to the given circle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given ellipse.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
- the closest point on the shape; or the point itself if it is inside the shape.
-
getClosestPointTo
default P getClosestPointTo(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afpReplies the closest point on this shape to the given segment.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given triangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given oriented rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given parallelogram.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given round rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2afpReplies the closest point on this shape to the given path.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointToin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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:Shape2DReplies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointToin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Parallelogram2afp<?,?,IE,P,V,B>,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.
-
isCCW
default boolean isCCW()
Replies if the axes of the parallelogram are defined in a counter-clockwise order.- Returns:
trueif the paralelogram axes are defined in a counter-clockwise order.
-
-