Class ContinuousBezier

java.lang.Object
org.opentrafficsim.core.geometry.ContinuousBezier
Direct Known Subclasses:
ContinuousBezierCubic

public class ContinuousBezier extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected org.djutils.draw.point.Point2d[]
    The shape points.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContinuousBezier(org.djutils.draw.point.Point2d... points)
    Create a Bezier of any order.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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
    Returns the estimated length using the method of numerical approach of Legendre-Gauss, which is quite accurate.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • points

      protected org.djutils.draw.point.Point2d[] points
      The 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

      public ContinuousBezier 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

      public String toString()
      Overrides:
      toString in class Object