Package org.opentrafficsim.core.geometry
Class ContinuousStraight
java.lang.Object
org.opentrafficsim.core.geometry.ContinuousStraight
- All Implemented Interfaces:
ContinuousLine
Continuous definition of a straight.
Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
ConstructorDescriptionContinuousStraight
(org.djutils.draw.point.OrientedPoint2d startPoint, double length) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.djutils.draw.line.PolyLine2d
flatten()
Polyline from continuous line.org.djutils.draw.line.PolyLine2d
Returns a 2-point line.org.djutils.draw.line.PolyLine2d
flattenOffset
(FractionalLengthData offsets, Flattener flattener) Returns the regular offset line of a 2-point line.double
End curvature.org.djutils.draw.point.OrientedPoint2d
End point.double
Return the length of the line.double
Start curvature.org.djutils.draw.point.OrientedPoint2d
Start point.org.djutils.draw.line.PolyLine2d
offset
(FractionalLengthData offsets) Offset polyline based on variable offset.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.core.geometry.ContinuousLine
getEndDirection, getEndRadius, getStartDirection, getStartRadius
-
Constructor Details
-
ContinuousStraight
public ContinuousStraight(org.djutils.draw.point.OrientedPoint2d startPoint, double length) Constructor.- Parameters:
startPoint
- DirectedPoint; start point.length
- double; length.
-
-
Method Details
-
getStartPoint
public org.djutils.draw.point.OrientedPoint2d getStartPoint()Start point.- Specified by:
getStartPoint
in interfaceContinuousLine
- Returns:
- OrientedPoint2d; start point.
-
getEndPoint
public org.djutils.draw.point.OrientedPoint2d getEndPoint()End point.- Specified by:
getEndPoint
in interfaceContinuousLine
- Returns:
- OrientedPoint2d; end point.
-
getStartCurvature
public double getStartCurvature()Start curvature.- Specified by:
getStartCurvature
in interfaceContinuousLine
- Returns:
- double; start curvature.
-
getEndCurvature
public double getEndCurvature()End curvature.- Specified by:
getEndCurvature
in interfaceContinuousLine
- Returns:
- double; end curvature.
-
flatten
public org.djutils.draw.line.PolyLine2d flatten()Polyline from continuous line. A straight uses no segments.- Returns:
- PolyLine2d; polyline.
-
flatten
Returns a 2-point line. Flattener is ignored.- Specified by:
flatten
in interfaceContinuousLine
- Parameters:
flattener
- Flattener; flattener (ignored).- Returns:
- PolyLine2d; flattened line.
-
offset
Offset polyline based on variable offset. A straight uses no segments, other than for varying offset.- Parameters:
offsets
- FractionalLengthData; offsets, should contain keys 0.0 and 1.0.- Returns:
- PolyLine2d; offset polyline.
-
flattenOffset
public org.djutils.draw.line.PolyLine2d flattenOffset(FractionalLengthData offsets, Flattener flattener) Returns the regular offset line of a 2-point line. Flattener is ignored.- Specified by:
flattenOffset
in interfaceContinuousLine
- Parameters:
offsets
- FractionalLengthData; offset data.flattener
- Flattener; flattener (ignored).- Returns:
- PolyLine2d; flattened line.
-
getLength
public double getLength()Return the length of the line.- Specified by:
getLength
in interfaceContinuousLine
- Returns:
- double; length of the line.
-
toString
-