Interface Triangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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 Implementing Classes:
Triangle2d,Triangle2dfx
public interface Triangle2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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 triangle on a plane.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND, Fevzi OZGUL
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTriangle2afp.AbstractTrianglePathIterator<T extends PathElement2afp>Abstract iterator on the path elements of the triangle.static classTriangle2afp.TransformedTrianglePathIterator<T extends PathElement2afp>Iterator on the path elements of the circle.static classTriangle2afp.TriangleFeatureFeatures of a triangle.static classTriangle2afp.TrianglePathIterator<T extends PathElement2afp>Iterator on the path elements of the triangle.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static doublecalculatesSquaredDistanceTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)Replies the squared distance from the given triangle to the given point.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 booleancontainsTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)Replies if the given point is inside the given triangle.static booleancontainsTriangleRectangle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double rx, double ry, double rwidth, double rheight)Replies if the given point is inside the given triangle.default booleanequalsToShape(IT shape)Replies this shape is equal to the given shape.static voidfindsClosestFarthestPointsTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py, Point2D<?,?> closest, Point2D<?,?> farthest)Replies the closest point to the given point inside the given triangle.static Triangle2afp.TriangleFeaturefindsClosestFeatureTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)Replies the closest feature of the triangle to the given point.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.default PgetP1()Replies the first point.default PgetP2()Replies the second point.default PgetP3()Replies the third point.default PathIterator2afp<IE>getPathIterator(Transform2D transform)Replies the elements of the paths.doublegetX1()Replies the first point X.doublegetX2()Replies the second point X.doublegetX3()Replies the third point X.doublegetY1()Replies the first point Y.doublegetY2()Replies the second point Y.doublegetY3()Replies the third point Y.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<?,?,?,?,?,?> sorientedRectangle)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 booleanintersectsTriangleCircle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double cx, double cy, double cradius)Replies if a triangle and a circle are intersecting.static booleanintersectsTriangleEllipse(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double ex, double ey, double ewidth, double eheight)Replies if a triangle and an ellipse are intersecting.static booleanintersectsTriangleRectangle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double rx, double ry, double rwidth, double rheight)Replies if a triangle and a rectangle are intersecting.static booleanintersectsTriangleSegment(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double sx1, double sy1, double sx2, double sy2)Replies if a triangle and a segment are intersecting.static booleanintersectsTriangleTriangle(double t1x1, double t1y1, double t1x2, double t1y2, double t1x3, double t1y3, double t2x1, double t2y1, double t2x2, double t2y2, double t2x3, double t2y3)Replies if two triangles are intersecting.booleanisCCW()Replies if the points of the triangle are defined in a counter-clockwise order.static booleanisCCW(double x1, double y1, double x2, double y2, double x3, double y3)Replies if three points of a triangle are defined in a counter-clockwise order.default booleanisEmpty()Replies if this shape is empty.voidset(double x1, double y1, double x2, double y2, double x3, double y3)Change the triangle.default voidset(IT shape)Set this shape with the attributes of the given shape.default voidsetP1(double x, double y)Change the first point.default voidsetP1(Point2D<?,?> point)Change the first point.default voidsetP2(double x, double y)Change the second point.default voidsetP2(Point2D<?,?> point)Change the second point.default voidsetP3(double x, double y)Change the third point.default voidsetP3(Point2D<?,?> point)Change the third point.voidsetX1(double x)Change the x coordinate of the first point.voidsetX2(double x)Change the x coordinate of the second point.voidsetX3(double x)Change the x coordinate of the third point.voidsetY1(double y)Change the y coordinate of the first point.voidsetY2(double y)Change the y coordinate of the second point.voidsetY3(double y)Change the y coordinate of the third point.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
-
findsClosestFeatureTrianglePoint
static Triangle2afp.TriangleFeature findsClosestFeatureTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)
Replies the closest feature of the triangle to the given point.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.px- x coordinate of the reference point.py- y coordinate of the reference point.- Returns:
- the closest triangle feature to the reference point.
-
isCCW
@Pure static boolean isCCW(double x1, double y1, double x2, double y2, double x3, double y3)Replies if three points of a triangle are defined in a counter-clockwise order.- Parameters:
x1- is the X coordinate of the first pointy1- is the Y coordinate of the first pointx2- is the X coordinate of the second pointy2- is the Y coordinate of the second pointx3- is the X coordinate of the third pointy3- is the Y coordinate of the third point- Returns:
trueif the three given points are defined in a counter-clockwise order.
-
isCCW
boolean isCCW()
Replies if the points of the triangle are defined in a counter-clockwise order.- Returns:
trueif the triangle points are defined in a counter-clockwise order.
-
containsTrianglePoint
@Pure static boolean containsTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)Replies if the given point is inside the given triangle.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.px- is the point to test.py- is the point to test.- Returns:
trueif the point is inside the triangle;falseif not.
-
containsTriangleRectangle
@Pure static boolean containsTriangleRectangle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double rx, double ry, double rwidth, double rheight)Replies if the given point is inside the given triangle.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.rx- is the x coordinate of the rectangle.ry- is the y coordinate of the rectangle.rwidth- the width of the rectangle.rheight- the height of the rectangle.- Returns:
trueif the rectangle is inside the triangle;falseif not.
-
findsClosestFarthestPointsTrianglePoint
static void findsClosestFarthestPointsTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py, Point2D<?,?> closest, Point2D<?,?> farthest)Replies the closest point to the given point inside the given triangle.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.px- is the point to test.py- is the point to test.closest- the closest point.farthest- the farthest point.
-
calculatesSquaredDistanceTrianglePoint
@Pure static double calculatesSquaredDistanceTrianglePoint(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double px, double py)Replies the squared distance from the given triangle to the given point.Caution: The points of the triangle must be defined in a CCW order.
- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.px- is the point.py- is the point.- Returns:
- the squared distance from the triangle to the point.
- See Also:
isCCW(double, double, double, double, double, double)
-
intersectsTriangleCircle
@Pure static boolean intersectsTriangleCircle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double cx, double cy, double cradius)Replies if a triangle and a circle are intersecting.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.cx- is the center of the circlecy- is the center of the circlecradius- is the radius of the circle- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsTriangleEllipse
@Pure static boolean intersectsTriangleEllipse(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double ex, double ey, double ewidth, double eheight)Replies if a triangle and an ellipse are intersecting.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.ex- is the position of the ellipseey- is the position of the ellipseewidth- is the width of the ellipseeheight- is the height of the ellipse- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsTriangleSegment
@Pure static boolean intersectsTriangleSegment(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double sx1, double sy1, double sx2, double sy2)Replies if a triangle and a segment are intersecting.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.sx1- x coordinate of the first point of the segment.sy1- y coordinate of the first point of the segment.sx2- x coordinate of the second point of the segment.sy2- y coordinate of the second point of the segment.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsTriangleTriangle
@Pure static boolean intersectsTriangleTriangle(double t1x1, double t1y1, double t1x2, double t1y2, double t1x3, double t1y3, double t2x1, double t2y1, double t2x2, double t2y2, double t2x3, double t2y3)Replies if two triangles are intersecting. The first triangle must be CCW ordered.- Parameters:
t1x1- x coordinate of the first point of the first triangle.t1y1- y coordinate of the first point of the first triangle.t1x2- x coordinate of the second point of the first triangle.t1y2- y coordinate of the second point of the first triangle.t1x3- x coordinate of the third point of the first triangle.t1y3- y coordinate of the third point of the first triangle.t2x1- x coordinate of the first point of the second triangle.t2y1- y coordinate of the first point of the second triangle.t2x2- x coordinate of the second point of the second triangle.t2y2- y coordinate of the second point of the second triangle.t2x3- x coordinate of the third point of the second triangle.t2y3- y coordinate of the third point of the second triangle.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
intersectsTriangleRectangle
@Pure static boolean intersectsTriangleRectangle(double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double rx, double ry, double rwidth, double rheight)Replies if a triangle and a rectangle are intersecting.- Parameters:
tx1- x coordinate of the first point of the triangle.ty1- y coordinate of the first point of the triangle.tx2- x coordinate of the second point of the triangle.ty2- y coordinate of the second point of the triangle.tx3- x coordinate of the third point of the triangle.ty3- y coordinate of the third point of the triangle.rx- x coordinate of the minimum corner of the rectangle.ry- y coordinate of the minimum corner of the rectangle.rwidth- width of the rectangle.rheight- height of the rectangle.- Returns:
trueif the two shapes are intersecting; otherwisefalse
-
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 Triangle2afp<?,?,IE,P,V,B>,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.
-
getX1
@Pure double getX1()
Replies the first point X.- Returns:
- the first point x.
-
getY1
@Pure double getY1()
Replies the first point Y.- Returns:
- the first point y.
-
getX2
@Pure double getX2()
Replies the second point X.- Returns:
- the second point x.
-
getY2
@Pure double getY2()
Replies the second point Y.- Returns:
- the second point y.
-
getX3
@Pure double getX3()
Replies the third point X.- Returns:
- the third point x.
-
getY3
@Pure double getY3()
Replies the third point Y.- Returns:
- the third point y.
-
getP1
@Pure default P getP1()
Replies the first point.- Returns:
- a copy of the first point.
-
getP2
@Pure default P getP2()
Replies the second point.- Returns:
- a copy of the second point.
-
getP3
@Pure default P getP3()
Replies the third point.- Returns:
- a copy of the third point.
-
setP1
default void setP1(Point2D<?,?> point)
Change the first point.- Parameters:
point- the point.
-
setP1
default void setP1(double x, double y)Change the first point.- Parameters:
x- x coordinate of the point.y- y coordinate of the point.
-
setP2
default void setP2(Point2D<?,?> point)
Change the second point.- Parameters:
point- the point.
-
setP2
default void setP2(double x, double y)Change the second point.- Parameters:
x- x coordinate of the point.y- y coordinate of the point.
-
setP3
default void setP3(Point2D<?,?> point)
Change the third point.- Parameters:
point- the point.
-
setP3
default void setP3(double x, double y)Change the third point.- Parameters:
x- x coordinate of the point.y- y coordinate of the point.
-
setX1
void setX1(double x)
Change the x coordinate of the first point.- Parameters:
x- x coordinate of the point.
-
setY1
void setY1(double y)
Change the y coordinate of the first point.- Parameters:
y- y coordinate of the point.
-
setX2
void setX2(double x)
Change the x coordinate of the second point.- Parameters:
x- x coordinate of the point.
-
setY2
void setY2(double y)
Change the y coordinate of the second point.- Parameters:
y- y coordinate of the point.
-
setX3
void setX3(double x)
Change the x coordinate of the third point.- Parameters:
x- x coordinate of the point.
-
setY3
void setY3(double y)
Change the y coordinate of the third point.- Parameters:
y- y coordinate of the point.
-
set
void set(double x1, double y1, double x2, double y2, double x3, double y3)Change the triangle.- Parameters:
x1- x coordinate of the first point.y1- y coordinate of the first point.x2- x coordinate of the second point.y2- y coordinate of the second point.x3- x coordinate of the third point.y3- y coordinate of the third point.
-
set
default void set(IT shape)
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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
shape- the shape to copy.
-
clear
default void clear()
Description copied from interface:Shape2DReset this shape to be equivalent to an just-created instance of this shape type.
-
toBoundingBox
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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
box- is set with the bounds of the shape.
-
isEmpty
default boolean isEmpty()
Description copied from interface:Shape2DReplies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmptyin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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.
-
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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
pt- the point- Returns:
- the distance.
-
contains
@Pure default boolean contains(double x, double y)Description copied from interface:Shape2afpReplies if the given point is inside this shape.- Specified by:
containsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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
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 Triangle2afp<?,?,IE,P,V,B>,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.
-
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 Triangle2afp<?,?,IE,P,V,B>,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.
-
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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
rectangle- the rectangle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given ellipse.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
ellipse- the ellipse.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given circle.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
circle- the circle.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afpReplies if this shape is intersecting the given line.- Specified by:
intersectsin interfaceShape2afp<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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(OrientedRectangle2afp<?,?,?,?,?,?> sorientedRectangle)
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 Triangle2afp<?,?,IE,P,V,B>,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:
sorientedRectangle- 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 Triangle2afp<?,?,IE,P,V,B>,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(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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
iterator- the path iterator.- Returns:
trueif this shape is intersecting the given shape;falseif there is no intersection.
-
intersects
@Pure default boolean intersects(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 Triangle2afp<?,?,IE,P,V,B>,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(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 Triangle2afp<?,?,IE,P,V,B>,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.
-
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 Triangle2afp<?,?,IE,P,V,B>,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
@Pure 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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,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 Triangle2afp<?,?,IE,P,V,B>,IE extends PathElement2afp,P extends Point2D<? super P,? super V>,V extends Vector2D<? super V,? super P>,B extends Rectangle2afp<?,?,IE,P,V,B>>- Parameters:
pt- the point.- Returns:
- the farthest point on the shape.
-
getPathIterator
@Pure default PathIterator2afp<IE> getPathIterator(Transform2D transform)
Description copied from interface:Shape2DReplies the elements of the paths.- Specified by:
getPathIteratorin interfaceShape2D<ST extends Shape2afp<?,?,IE,P,V,B>,IT extends Triangle2afp<?,?,IE,P,V,B>,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.
-
-