Package org.arakhne.afc.math.geometry.d1
Interface Segment1D<RP extends Point2D<?,?>,RV extends Vector2D<?,?>>
-
- 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 Known Subinterfaces:
RoadSegment
- All Known Implementing Classes:
DefaultSegment1d
,RoadAStar.VirtualSegment
,RoadPolyline
,SubRoadNetwork.WrapSegment
public interface Segment1D<RP extends Point2D<?,?>,RV extends Vector2D<?,?>>
This class represents a segment is a 1.5D coordinate space.A 1.5D point is defined by its curviline position on a segment, and by a jutting/shifting distance. The jutting distance is positive or negative according to the side vector of the current
CoordinateSystem2D
.A segment could be implemented by a line, a spline or a polyline.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RP
getFirstPoint()
Replies the 2D cooordinate of the first point of the segment.RP
getLastPoint()
Replies the 2D cooordinates of the last point of the segment.double
getLength()
Replies the length of the segment.RV
getTangentAt(double positionOnSegment)
Replies the 2D tangent at the position on the segment.boolean
isFirstPointConnectedTo(Segment1D<?,?> otherSegment)
Replies if this segment is connected to the specified segment by its first point.boolean
isLastPointConnectedTo(Segment1D<?,?> otherSegment)
Replies if this segment is connected to the specified segment by its last point.void
projectsOnPlane(double positionOnSegment, double shiftDistance, Point2D<?,?> position, Vector2D<?,?> tangent)
Replies the 2D position and the 2D tangent at the position on the segment.void
projectsOnPlane(double positionOnSegment, Point2D<?,?> position, Vector2D<?,?> tangent)
Replies the 2D position and the 2D tangent at the position on the segment.
-
-
-
Method Detail
-
getLength
@Pure double getLength()
Replies the length of the segment.- Returns:
- the length of the segment.
-
getFirstPoint
@Pure RP getFirstPoint()
Replies the 2D cooordinate of the first point of the segment.- Returns:
- the 2D coordinate or
null
if 2D mapping is impossible.
-
getLastPoint
@Pure RP getLastPoint()
Replies the 2D cooordinates of the last point of the segment.- Returns:
- the 2D coordinates or
null
if 2D mapping is impossible.
-
getTangentAt
@Pure RV getTangentAt(double positionOnSegment)
Replies the 2D tangent at the position on the segment.- Parameters:
positionOnSegment
- is the position on the segment (in0..length
).- Returns:
- the 2D tangent at the position on the segment.
-
projectsOnPlane
void projectsOnPlane(double positionOnSegment, Point2D<?,?> position, Vector2D<?,?> tangent)
Replies the 2D position and the 2D tangent at the position on the segment.- Parameters:
positionOnSegment
- is the position on the segment (in0..length
).position
- is the position to fill.tangent
- is the tangent to the segment at the given position.
-
projectsOnPlane
void projectsOnPlane(double positionOnSegment, double shiftDistance, Point2D<?,?> position, Vector2D<?,?> tangent)
Replies the 2D position and the 2D tangent at the position on the segment.- Parameters:
positionOnSegment
- is the position on the segment (in0..length
).shiftDistance
- is the distance that permits to shift the position from the segment.position
- is the position to fill.tangent
- is the tangent to the segment at the given position.
-
isFirstPointConnectedTo
@Pure boolean isFirstPointConnectedTo(Segment1D<?,?> otherSegment)
Replies if this segment is connected to the specified segment by its first point.- Parameters:
otherSegment
- is the segment to match.- Returns:
true
if this segment is connected to the given one, otherwisefalse
.
-
isLastPointConnectedTo
@Pure boolean isLastPointConnectedTo(Segment1D<?,?> otherSegment)
Replies if this segment is connected to the specified segment by its last point.- Parameters:
otherSegment
- is the segment to match.- Returns:
true
if this segment is connected to the given one, otherwisefalse
.
-
-