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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.core.geometry.ContinuousLine
ContinuousLine.ContinuousDoubleFunction -
Constructor Summary
ConstructorsConstructorDescriptionContinuousArc(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.PolyLine2dFlatten continuous line in to a polyline.org.djutils.draw.line.PolyLine2dflattenOffset(ContinuousLine.ContinuousDoubleFunction offset, Flattener flattener) Flatten continuous line offset in to a polyline.doubleEnd curvature.org.djutils.draw.point.OrientedPoint2dEnd point.doubleEnd radius.doubleReturn the length of the line.doubleStart curvature.org.djutils.draw.point.OrientedPoint2dStart point.doubleStart radius.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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- starting point.radius- radius (must be positive).left- left curve, or right.length- 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- starting point.radius- radius (must be positive).left- left curve, or right.angle- angle of arc (must be positive).
-
-
Method Details
-
getStartPoint
public org.djutils.draw.point.OrientedPoint2d getStartPoint()Description copied from interface:ContinuousLineStart point.- Specified by:
getStartPointin interfaceContinuousLine- Returns:
- start point
-
getEndPoint
public org.djutils.draw.point.OrientedPoint2d getEndPoint()Description copied from interface:ContinuousLineEnd point.- Specified by:
getEndPointin interfaceContinuousLine- Returns:
- end point
-
getStartCurvature
public double getStartCurvature()Description copied from interface:ContinuousLineStart curvature.- Specified by:
getStartCurvaturein interfaceContinuousLine- Returns:
- start curvature
-
getEndCurvature
public double getEndCurvature()Description copied from interface:ContinuousLineEnd curvature.- Specified by:
getEndCurvaturein interfaceContinuousLine- Returns:
- end curvature
-
getStartRadius
public double getStartRadius()Description copied from interface:ContinuousLineStart radius.- Specified by:
getStartRadiusin interfaceContinuousLine- Returns:
- start radius
-
getEndRadius
public double getEndRadius()Description copied from interface:ContinuousLineEnd radius.- Specified by:
getEndRadiusin interfaceContinuousLine- Returns:
- end radius
-
flatten
Description copied from interface:ContinuousLineFlatten continuous line in to a polyline. Implementations should use the flattener when relevant and possible.- Specified by:
flattenin interfaceContinuousLine- Parameters:
flattener- flattener- Returns:
- flattened line
-
flattenOffset
public org.djutils.draw.line.PolyLine2d flattenOffset(ContinuousLine.ContinuousDoubleFunction offset, Flattener flattener) Description copied from interface:ContinuousLineFlatten continuous line offset in to a polyline. Implementations should use the flattener when relevant and possible.- Specified by:
flattenOffsetin interfaceContinuousLine- Parameters:
offset- offset dataflattener- flattener- Returns:
- flattened line
-
getLength
public double getLength()Description copied from interface:ContinuousLineReturn the length of the line.- Specified by:
getLengthin interfaceContinuousLine- Returns:
- length of the line
-
toString
-