Package org.djutils.draw.curve
Interface Curve2d
- All Superinterfaces:
Curve<DirectedPoint2d,
,Double, Point2d, Flattener2d, PolyLine2d> Flattener.FlattableCurve<Point2d,
Double>
- All Known Subinterfaces:
OffsetCurve2d
- All Known Implementing Classes:
Arc2d
,Bezier2d
,BezierCubic2d
,Clothoid2d
,Straight2d
interface Curve2d
extends Curve<DirectedPoint2d,Double,Point2d,Flattener2d,PolyLine2d>, Flattener.FlattableCurve<Point2d,Double>
This interface narrows down the interface of continuous curves for 2d use.
Copyright (c) 2023-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and TypeMethodDescriptiondefault Double
getDirection
(double fraction) Returns the direction at the given fraction.default Double
End direction of this Curve.default DirectedPoint2d
End point of this Curve.default Double
Start direction of this Curve.default DirectedPoint2d
Start point of this Curve.Methods inherited from interface org.djutils.draw.curve.Curve
getKnots, getLength, getPoint, toPolyLine
Methods inherited from interface org.djutils.draw.curve.Flattener.FlattableCurve
getPoint
-
Method Details
-
getStartPoint
Description copied from interface:Curve
Start point of this Curve.- Specified by:
getStartPoint
in interfaceCurve<DirectedPoint2d,
Double, Point2d, Flattener2d, PolyLine2d> - Returns:
- start point of this Curve
-
getEndPoint
Description copied from interface:Curve
End point of this Curve.- Specified by:
getEndPoint
in interfaceCurve<DirectedPoint2d,
Double, Point2d, Flattener2d, PolyLine2d> - Returns:
- end point of this Curve
-
getStartDirection
Description copied from interface:Curve
Start direction of this Curve.- Specified by:
getStartDirection
in interfaceCurve<DirectedPoint2d,
Double, Point2d, Flattener2d, PolyLine2d> - Returns:
- start direction of this Curve
-
getEndDirection
Description copied from interface:Curve
End direction of this Curve.- Specified by:
getEndDirection
in interfaceCurve<DirectedPoint2d,
Double, Point2d, Flattener2d, PolyLine2d> - Returns:
- end direction of this Curve
-
getDirection
Description copied from interface:Curve
Returns the direction at the given fraction. The fraction may represent any parameter, such as t in a Bézier curve, s in a Clothoid, or simply the fraction of length. The default implementation performs a numerical approach by looking at the direction between the points at fraction, and a point 1e-6 away.- Specified by:
getDirection
in interfaceCurve<DirectedPoint2d,
Double, Point2d, Flattener2d, PolyLine2d> - Specified by:
getDirection
in interfaceFlattener.FlattableCurve<Point2d,
Double> - Parameters:
fraction
- the fraction- Returns:
- the direction at the given
fraction
-