Package org.opentrafficsim.core.geometry
Class ContinuousBezier
java.lang.Object
org.opentrafficsim.core.geometry.ContinuousBezier
- Direct Known Subclasses:
ContinuousBezierCubic
Continuous definition of a Bezier. Note that this class does not implement
ContinuousLine
. This class is simply a
helper class for (and a super of) ContinuousBezierCubic
, which uses this class to determine curvature, offset lines,
etc.
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
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.djutils.draw.point.Point2d[]
The shape points. -
Constructor Summary
ConstructorDescriptionContinuousBezier
(org.djutils.draw.point.Point2d... points) Create a Bezier of any order. -
Method Summary
Modifier and TypeMethodDescriptionorg.djutils.draw.point.Point2d
at
(double t) Return the point for the given t value.double
curvature
(double t) Returns the curvature at the given t value.Returns the derivative for a Bezier, which is a Bezier of 1 order lower.double
length()
Returns the estimated length using the method of numerical approach of Legendre-Gauss, which is quite accurate.toString()
-
Field Details
-
points
protected org.djutils.draw.point.Point2d[] pointsThe shape points.
-
-
Constructor Details
-
ContinuousBezier
public ContinuousBezier(org.djutils.draw.point.Point2d... points) Create a Bezier of any order.- Parameters:
points
- Point2d... shape points.
-
-
Method Details
-
derivative
Returns the derivative for a Bezier, which is a Bezier of 1 order lower.- Returns:
- ContinuousBezier; derivative Bezier.
-
length
public double length()Returns the estimated length using the method of numerical approach of Legendre-Gauss, which is quite accurate.- Returns:
- double; estimated length.
-
at
public org.djutils.draw.point.Point2d at(double t) Return the point for the given t value.- Parameters:
t
- double; t value, moving from 0 to 1 along the Bezier.- Returns:
- Point2d; point of the Bezier at t.
-
curvature
public double curvature(double t) Returns the curvature at the given t value.- Parameters:
t
- double; t value, moving from 0 to 1 along the Bezier.- Returns:
- double curvature at the given t value.
-
toString
-