Class ContinuousArc

java.lang.Object
org.opentrafficsim.core.geometry.ContinuousArc
All Implemented Interfaces:
ContinuousLine

public class ContinuousArc extends Object implements 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 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: ContinuousLine
      Start point.
      Specified by:
      getStartPoint in interface ContinuousLine
      Returns:
      start point
    • getEndPoint

      public org.djutils.draw.point.OrientedPoint2d getEndPoint()
      Description copied from interface: ContinuousLine
      End point.
      Specified by:
      getEndPoint in interface ContinuousLine
      Returns:
      end point
    • getStartCurvature

      public double getStartCurvature()
      Description copied from interface: ContinuousLine
      Start curvature.
      Specified by:
      getStartCurvature in interface ContinuousLine
      Returns:
      start curvature
    • getEndCurvature

      public double getEndCurvature()
      Description copied from interface: ContinuousLine
      End curvature.
      Specified by:
      getEndCurvature in interface ContinuousLine
      Returns:
      end curvature
    • getStartRadius

      public double getStartRadius()
      Description copied from interface: ContinuousLine
      Start radius.
      Specified by:
      getStartRadius in interface ContinuousLine
      Returns:
      start radius
    • getEndRadius

      public double getEndRadius()
      Description copied from interface: ContinuousLine
      End radius.
      Specified by:
      getEndRadius in interface ContinuousLine
      Returns:
      end radius
    • flatten

      public org.djutils.draw.line.PolyLine2d flatten(Flattener flattener)
      Description copied from interface: ContinuousLine
      Flatten continuous line in to a polyline. Implementations should use the flattener when relevant and possible.
      Specified by:
      flatten in interface ContinuousLine
      Parameters:
      flattener - flattener
      Returns:
      flattened line
    • flattenOffset

      public org.djutils.draw.line.PolyLine2d flattenOffset(ContinuousLine.ContinuousDoubleFunction offset, Flattener flattener)
      Description copied from interface: ContinuousLine
      Flatten continuous line offset in to a polyline. Implementations should use the flattener when relevant and possible.
      Specified by:
      flattenOffset in interface ContinuousLine
      Parameters:
      offset - offset data
      flattener - flattener
      Returns:
      flattened line
    • getLength

      public double getLength()
      Description copied from interface: ContinuousLine
      Return the length of the line.
      Specified by:
      getLength in interface ContinuousLine
      Returns:
      length of the line
    • toString

      public String toString()
      Overrides:
      toString in class Object