Package org.opentrafficsim.core.geometry
Class ContinuousArc
java.lang.Object
org.opentrafficsim.core.geometry.ContinuousArc
- All Implemented Interfaces:
ContinuousLine
Continuous definition of an arc.
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
ConstructorDescriptionContinuousArc
(org.djutils.draw.point.OrientedPoint2d startPoint, double radius, boolean left, double length) Define arc by starting point, radius, curve direction, and length.ContinuousArc
(org.djutils.draw.point.OrientedPoint2d startPoint, double radius, boolean left, org.djunits.value.vdouble.scalar.Angle angle) Define arc by starting point, radius, curve direction, and angle. -
Method Summary
Modifier and TypeMethodDescriptionorg.djutils.draw.line.PolyLine2d
Flatten continuous line in to a polyline.org.djutils.draw.line.PolyLine2d
flattenOffset
(FractionalLengthData offsets, Flattener flattener) Flatten continuous line offset in to a polyline.double
End curvature.org.djutils.draw.point.OrientedPoint2d
End point.double
End radius.double
Return the length of the line.double
Start curvature.org.djutils.draw.point.OrientedPoint2d
Start point.double
Start radius.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, getStartDirection
-
Constructor Details
-
ContinuousArc
public ContinuousArc(org.djutils.draw.point.OrientedPoint2d startPoint, double radius, boolean left, double length) Define arc by starting point, radius, curve direction, and length.- Parameters:
startPoint
- OrientedPoint2d; starting point.radius
- double; radius (must be positive).left
- boolean; left curve, or right.length
- double; arc length.
-
ContinuousArc
public ContinuousArc(org.djutils.draw.point.OrientedPoint2d startPoint, double radius, boolean left, org.djunits.value.vdouble.scalar.Angle angle) Define arc by starting point, radius, curve direction, and angle.- Parameters:
startPoint
- OrientedPoint2d; starting point.radius
- double; radius (must be positive).left
- boolean; left curve, or right.angle
- Angle; angle of arc (must be positive).
-
-
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.
-
getStartRadius
public double getStartRadius()Start radius.- Specified by:
getStartRadius
in interfaceContinuousLine
- Returns:
- double; start radius.
-
getEndRadius
public double getEndRadius()End radius.- Specified by:
getEndRadius
in interfaceContinuousLine
- Returns:
- double; end radius.
-
flatten
Flatten continuous line in to a polyline. Implementations should use the flattener when relevant and possible.- Specified by:
flatten
in interfaceContinuousLine
- Parameters:
flattener
- Flattener; flattener.- Returns:
- PolyLine2d; flattened line.
-
flattenOffset
public org.djutils.draw.line.PolyLine2d flattenOffset(FractionalLengthData offsets, Flattener flattener) Flatten continuous line offset in to a polyline. Implementations should use the flattener when relevant and possible.- Specified by:
flattenOffset
in interfaceContinuousLine
- Parameters:
offsets
- FractionalLengthData; offset data.flattener
- Flattener; flattener.- 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
-