Package org.arakhne.afc.math.geometry.d2
Interface OrientedPoint2D<RP extends Point2D<? super RP,? super RV>,RV extends Vector2D<? super RV,? super RP>>
-
- Type Parameters:
RP
- is the type of point that can be returned by this tuple.RV
- is the type of vector that can be returned by this tuple.
- All Superinterfaces:
Cloneable
,JsonableObject
,Point2D<RP,RV>
,Serializable
,Tuple2D<RP>
- All Known Implementing Classes:
OrientedPoint2d
,OrientedPoint2dfx
,OrientedPoint2i
,OrientedPoint2ifx
public interface OrientedPoint2D<RP extends Point2D<? super RP,? super RV>,RV extends Vector2D<? super RV,? super RP>> extends Point2D<RP,RV>
A 2D point with two orientation vectors relative to the polyline: the direction and the normal to the point.The orientation vectors have no physical existence, i.e. they exist only to represent the direction of the point and its normal when the point is part of a polyline. The normal vector is always perpendicular to the direction vector. The point stores its length on the polyline to avoid rounding errors at discretization.
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND, Olivier LAMOTTE
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
equals(OrientedPoint2D<?,?> p1)
Returns true if all of the data members of OrientedPoint2D p1 are equal to the corresponding data members in this OrientedPoint2D.RV
getNormal()
Replies the normal vector at this point.default double
getNormalX()
Replies the X coordinate of the normal vector.default double
getNormalY()
Replies the Y coordinate of the normal vector.default RP
getPoint()
Replies this point.RV
getTangent()
Replies the tangent vector at this point.double
getTangentX()
Replies the X coordinate of the direction vector.double
getTangentY()
Replies the Y coordinate of the direction vector.default int
inx()
Replies the X coordinate of the normal vector.default int
iny()
Replies the Y coordinate of the normal vector.int
itx()
Replies the X coordinate of the direction vector.int
ity()
Replies the Y coordinate of the direction vector.default void
set(double x, double y, double tanX, double tanY)
Change the point and its orientation vector.default void
set(int x, int y, int tanX, int tanY)
Change the point and its tangent vector.default void
setTangent(double x, double y)
Change the tangent vector.default void
setTangent(int x, int y)
Change the tangent vector.default void
setTangent(RV tangent)
Sets the given vector as the new tangent to this point.void
setTangentX(double tanX)
Sets a new value in the X direction of the point.void
setTangentX(int tanX)
Sets a new value in the X direction of the point.void
setTangentY(double tanY)
Sets a new value in the Y direction of the point.void
setTangentY(int tanY)
Sets a new value in the Y direction of the point.-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Point2D
$amp$amp, $minus, $minus, $minus, $plus, $plus, add, add, add, getDistance, getDistanceL1, getDistanceLinf, getDistanceSquared, getGeomFactory, getIdistanceL1, getIdistanceLinf, operator_add, operator_and, operator_elvis, operator_equals, operator_minus, operator_minus, operator_minus, operator_notEquals, operator_plus, operator_plus, operator_remove, operator_upTo, operator_upTo, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleAdd, sub, sub, toUnmodifiable, turn, turn, turn, turnLeft, turnLeft, turnLeft, turnRight, turnRight, turnRight
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Tuple2D
absolute, absolute, add, add, addX, addX, addY, addY, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, get, getX, getY, hashCode, interpolate, interpolate, ix, iy, negate, negate, scale, scale, scale, scale, set, set, set, set, set, setX, setX, setY, setY, sub, sub, subX, subX, subY, subY
-
-
-
-
Method Detail
-
getTangentX
@Pure double getTangentX()
Replies the X coordinate of the direction vector. If this point is not part of a polyline, the direction vector is null.- Returns:
- the x coordinate of the direction vector.
-
itx
@Pure int itx()
Replies the X coordinate of the direction vector. If this point is not part of a polyline, the direction vector is null.- Returns:
- the x coordinate of the direction vector.
-
setTangentX
void setTangentX(int tanX)
Sets a new value in the X direction of the point.- Parameters:
tanX
- the new value double x.
-
setTangentX
void setTangentX(double tanX)
Sets a new value in the X direction of the point.- Parameters:
tanX
- the new value double x.
-
getTangentY
@Pure double getTangentY()
Replies the Y coordinate of the direction vector. If this point is not part of a polyline, the direction vector is null.- Returns:
- the y coordinate of the direction vector.
-
ity
@Pure int ity()
Replies the Y coordinate of the direction vector. If this point is not part of a polyline, the direction vector is null.- Returns:
- the y coordinate of the direction vector.
-
setTangentY
void setTangentY(int tanY)
Sets a new value in the Y direction of the point.- Parameters:
tanY
- the new value double y.
-
setTangentY
void setTangentY(double tanY)
Sets a new value in the Y direction of the point.- Parameters:
tanY
- the new value double y.
-
getNormalX
@Pure default double getNormalX()
Replies the X coordinate of the normal vector. If this point is not part of a polyline, the normal vector is null.- Returns:
- the x coordinate of the normal vector.
-
inx
@Pure default int inx()
Replies the X coordinate of the normal vector. If this point is not part of a polyline, the normal vector is null.- Returns:
- the x coordinate of the normal vector.
-
getNormalY
@Pure default double getNormalY()
Replies the Y coordinate of the normal vector. If this point is not part of a polyline, the normal vector is null.- Returns:
- the y coordinate of the normal vector.
-
iny
@Pure default int iny()
Replies the Y coordinate of the normal vector. If this point is not part of a polyline, the normal vector is null.- Returns:
- the y coordinate of the normal vector.
-
getPoint
default RP getPoint()
Replies this point.- Returns:
- this point
-
getTangent
@Pure RV getTangent()
Replies the tangent vector at this point.- Returns:
- the tangent vector.
-
setTangent
default void setTangent(RV tangent)
Sets the given vector as the new tangent to this point. The normal vector is automatically recomputed.- Parameters:
tangent
- the vector to set.
-
setTangent
default void setTangent(double x, double y)
Change the tangent vector. The normal vector is automatically recomputed.- Parameters:
x
- x coordinate of the vector.y
- y coordinate of the vector.
-
setTangent
default void setTangent(int x, int y)
Change the tangent vector. The normal vector is automatically recomputed.- Parameters:
x
- x coordinate of the vector.y
- y coordinate of the vector.
-
getNormal
@Pure RV getNormal()
Replies the normal vector at this point.- Returns:
- the normal vector.
-
set
default void set(int x, int y, int tanX, int tanY)
Change the point and its tangent vector.- Parameters:
x
- x coordinate of the point.y
- y coordinate of the point.tanX
- x coordinate of the vector.tanY
- y coordinate of the vector.
-
set
default void set(double x, double y, double tanX, double tanY)
Change the point and its orientation vector.- Parameters:
x
- x coordinate of the point.y
- y coordinate of the point.tanX
- x coordinate of the vector.tanY
- y coordinate of the vector.
-
equals
@Pure default boolean equals(OrientedPoint2D<?,?> p1)
Returns true if all of the data members of OrientedPoint2D p1 are equal to the corresponding data members in this OrientedPoint2D.- Parameters:
p1
- the point with which the comparison is made- Returns:
- true or false
-
-