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 class
Triangle2afp.AbstractTrianglePathIterator<T extends PathElement2afp>
Abstract iterator on the path elements of the triangle.static class
Triangle2afp.TransformedTrianglePathIterator<T extends PathElement2afp>
Iterator on the path elements of the circle.static class
Triangle2afp.TriangleFeature
Features of a triangle.static class
Triangle2afp.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 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.default void
clear()
Reset this shape to be equivalent to an just-created instance of this shape type.default boolean
contains(double x, double y)
Replies if the given point is inside this shape.default boolean
contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies if the given rectangle is inside this shape.static boolean
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.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.default boolean
equalsToShape(IT shape)
Replies this shape is equal to the given shape.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.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.default P
getClosestPointTo(Circle2afp<?,?,?,?,?,?> circle)
Replies the closest point on this shape to the given circle.default P
getClosestPointTo(Ellipse2afp<?,?,?,?,?,?> ellipse)
Replies the closest point on this shape to the given ellipse.default P
getClosestPointTo(OrientedRectangle2afp<?,?,?,?,?,?> orientedRectangle)
Replies the closest point on this shape to the given oriented rectangle.default P
getClosestPointTo(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Replies the closest point on this shape to the given parallelogram.default P
getClosestPointTo(Path2afp<?,?,?,?,?,?> path)
Replies the closest point on this shape to the given path.default P
getClosestPointTo(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies the closest point on this shape to the given rectangle.default P
getClosestPointTo(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Replies the closest point on this shape to the given round rectangle.default P
getClosestPointTo(Segment2afp<?,?,?,?,?,?> segment)
Replies the closest point on this shape to the given segment.default P
getClosestPointTo(Triangle2afp<?,?,?,?,?,?> triangle)
Replies the closest point on this shape to the given triangle.default P
getClosestPointTo(Point2D<?,?> pt)
Replies the point on the shape that is closest to the given point.default double
getDistanceL1(Point2D<?,?> pt)
Computes the L-1 (Manhattan) distance between this shape and point p1.default double
getDistanceLinf(Point2D<?,?> pt)
Computes the L-infinite distance between this shape and point p1.default double
getDistanceSquared(Point2D<?,?> pt)
Replies the squared value of the minimal distance from this shape to the given point.default P
getFarthestPointTo(Point2D<?,?> pt)
Replies the point on the shape that is farthest the given point.default P
getP1()
Replies the first point.default P
getP2()
Replies the second point.default P
getP3()
Replies the third point.default PathIterator2afp<IE>
getPathIterator(Transform2D transform)
Replies the elements of the paths.double
getX1()
Replies the first point X.double
getX2()
Replies the second point X.double
getX3()
Replies the third point X.double
getY1()
Replies the first point Y.double
getY2()
Replies the second point Y.double
getY3()
Replies the third point Y.default boolean
intersects(Circle2afp<?,?,?,?,?,?> circle)
Replies if this shape is intersecting the given circle.default boolean
intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Replies if this shape is intersecting the given ellipse.default boolean
intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Replies if this shape is intersecting the given multishape.default boolean
intersects(OrientedRectangle2afp<?,?,?,?,?,?> sorientedRectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Replies if this shape is intersecting the given parallelogram.default boolean
intersects(PathIterator2afp<?> iterator)
Replies if this shape is intersecting the shape representing the given path iterator.default boolean
intersects(Rectangle2afp<?,?,?,?,?,?> rectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Replies if this shape is intersecting the given rectangle.default boolean
intersects(Segment2afp<?,?,?,?,?,?> segment)
Replies if this shape is intersecting the given line.default boolean
intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Replies if this shape is intersecting the given triangle.static boolean
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.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.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.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.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.boolean
isCCW()
Replies if the points of the triangle are defined in a counter-clockwise order.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.default boolean
isEmpty()
Replies if this shape is empty.void
set(double x1, double y1, double x2, double y2, double x3, double y3)
Change the triangle.default void
set(IT shape)
Set this shape with the attributes of the given shape.default void
setP1(double x, double y)
Change the first point.default void
setP1(Point2D<?,?> point)
Change the first point.default void
setP2(double x, double y)
Change the second point.default void
setP2(Point2D<?,?> point)
Change the second point.default void
setP3(double x, double y)
Change the third point.default void
setP3(Point2D<?,?> point)
Change the third point.void
setX1(double x)
Change the x coordinate of the first point.void
setX2(double x)
Change the x coordinate of the second point.void
setX3(double x)
Change the x coordinate of the third point.void
setY1(double y)
Change the y coordinate of the first point.void
setY2(double y)
Change the y coordinate of the second point.void
setY3(double y)
Change the y coordinate of the third point.default void
toBoundingBox(B box)
Replies the bounds of the shape.default void
translate(double dx, double dy)
Translate the shape.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.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:
true
if 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:
true
if 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:
true
if the point is inside the triangle;false
if 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:
true
if the rectangle is inside the triangle;false
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if the two shapes are intersecting; otherwisefalse
-
equalsToShape
@Pure default boolean equalsToShape(IT shape)
Description copied from interface:Shape2D
Replies this shape is equal to the given shape.- Specified by:
equalsToShape
in 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:
true
if 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:Shape2D
Set this shape with the attributes of the given shape.- Specified by:
set
in 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:Shape2D
Reset this shape to be equivalent to an just-created instance of this shape type.
-
toBoundingBox
default void toBoundingBox(B box)
Description copied from interface:Shape2D
Replies the bounds of the shape.- Specified by:
toBoundingBox
in 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:Shape2D
Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmpty
in 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:
true
if the shape is empty;false
otherwise.
-
getDistanceSquared
@Pure default double getDistanceSquared(Point2D<?,?> pt)
Description copied from interface:Shape2D
Replies the squared value of the minimal distance from this shape to the given point.- Specified by:
getDistanceSquared
in 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:Shape2D
Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).- Specified by:
getDistanceL1
in 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:Shape2D
Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].- Specified by:
getDistanceLinf
in 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:Shape2afp
Replies if the given point is inside this shape.- Specified by:
contains
in 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:
true
if the given point is inside this shape, otherwisefalse
.
-
contains
default boolean contains(Rectangle2afp<?,?,?,?,?,?> rectangle)
Description copied from interface:Shape2afp
Replies if the given rectangle is inside this shape.- Specified by:
contains
in 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:
true
if the given rectangle is inside this shape, otherwisefalse
.
-
translate
default void translate(double dx, double dy)
Description copied from interface:Shape2afp
Translate the shape.- Specified by:
translate
in 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:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Ellipse2afp<?,?,?,?,?,?> ellipse)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given ellipse.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Circle2afp<?,?,?,?,?,?> circle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given circle.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Segment2afp<?,?,?,?,?,?> segment)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given line.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Triangle2afp<?,?,?,?,?,?> triangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given triangle.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(OrientedRectangle2afp<?,?,?,?,?,?> sorientedRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(Parallelogram2afp<?,?,?,?,?,?> parallelogram)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given parallelogram.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(PathIterator2afp<?> iterator)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the shape representing the given path iterator.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(RoundRectangle2afp<?,?,?,?,?,?> roundRectangle)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given rectangle.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
intersects
@Pure default boolean intersects(MultiShape2afp<?,?,?,?,?,?,?> multishape)
Description copied from interface:Shape2afp
Replies if this shape is intersecting the given multishape.- Specified by:
intersects
in 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:
true
if this shape is intersecting the given shape;false
if there is no intersection.
-
getClosestPointTo
@Pure default P getClosestPointTo(Point2D<?,?> pt)
Description copied from interface:Shape2D
Replies the point on the shape that is closest to the given point.- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given circle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given ellipse.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given segment.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given triangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given oriented rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given parallelogram.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given round rectangle.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2afp
Replies the closest point on this shape to the given path.If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.
- Specified by:
getClosestPointTo
in 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:Shape2D
Replies the point on the shape that is farthest the given point.- Specified by:
getFarthestPointTo
in 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:Shape2D
Replies the elements of the paths.- Specified by:
getPathIterator
in 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.
-
-