Class Clothoid

java.lang.Object
org.opentrafficsim.core.geometry.Clothoid

public final class Clothoid extends Object
Generate an OtsLine3d for a clothoid.
Derived from odrSpiral.c by M. Dupuis @ VIRES GmbH
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at
 
            http://www.apache.org/licenses/LICENSE-2.0
 
        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
 

Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
M. Dupuis @ VIRES GmbH, Alexander Verbraeck, Peter Knoppers
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final double[]
    C(x) for small x denominator.
    (package private) static final double[]
    C(x) for small x numerator.
    (package private) static final double[]
    Auxiliary function f(x) denominator.
    (package private) static final double[]
    Auxiliary function f(x) numerator.
    (package private) static final double[]
    Auxiliary function g(x) denominator.
    (package private) static final double[]
    Auxiliary function g(x) numerator.
    (package private) static final double[]
    S(x) for small x denominator.
    (package private) static final double[]
    S(x) for small x numerator.
  • Method Summary

    Modifier and Type
    Method
    Description
    static OtsLine3d
    clothoid(OtsPoint3d start, Direction startDirection, double startCurvature, double endCurvature, Length length, Length endElevation, int numSegments)
    Approximate a clothoid.
    static OtsLine3d
    clothoid(OtsPoint3d start, Direction startDirection, double endCurvature, Length length, Length endElevation, int numSegments)
    Approximate a clothoid with curvature 0 at start.
    static OtsLine3d
    clothoid(OtsPoint3d start, Direction startDirection, LinearDensity endCurvature, Length length, Length endElevation, int numSegments)
    Approximate a clothoid with curvature 0 at start.
    static OtsLine3d
    clothoid(OtsPoint3d start, Direction startDirection, LinearDensity startCurvature, LinearDensity endCurvature, Length length, Length endElevation, int numSegments)
    Approximate a clothoid.
    static void
    main(String[] args)
    Demonstrate / test the clothoid methods.

    Methods inherited from class java.lang.Object

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

    • SN

      static final double[] SN
      S(x) for small x numerator.
    • SD

      static final double[] SD
      S(x) for small x denominator.
    • CN

      static final double[] CN
      C(x) for small x numerator.
    • CD

      static final double[] CD
      C(x) for small x denominator.
    • FN

      static final double[] FN
      Auxiliary function f(x) numerator.
    • FD

      static final double[] FD
      Auxiliary function f(x) denominator.
    • GN

      static final double[] GN
      Auxiliary function g(x) numerator.
    • GD

      static final double[] GD
      Auxiliary function g(x) denominator.
  • Method Details

    • clothoid

      public static OtsLine3d clothoid(OtsPoint3d start, Direction startDirection, double endCurvature, Length length, Length endElevation, int numSegments) throws OtsGeometryException
      Approximate a clothoid with curvature 0 at start.
      Parameters:
      start - OtsPoint3d; starting point of the clothoid
      startDirection - Direction; start direction of the clothoid
      endCurvature - double; curvature at the end of the clothoid [1/m]
      length - Length; length of the clothoid
      endElevation - Length; elevation at end of the clothoid
      numSegments - int; number of segments used to approximate (the number of points is one higher than this)
      Returns:
      OtsLine3d; the clothoid
      Throws:
      OtsGeometryException - if the number of segments is too low
    • clothoid

      public static OtsLine3d clothoid(OtsPoint3d start, Direction startDirection, double startCurvature, double endCurvature, Length length, Length endElevation, int numSegments) throws OtsGeometryException
      Approximate a clothoid.
      Parameters:
      start - OtsPoint3d; starting point of the clothoid
      startDirection - Direction; start direction of the clothoid
      startCurvature - double; curvature at the start of the clothoid [1/m]
      endCurvature - double; curvature at the end of the clothoid [1/m]
      length - Length; length of the clothoid
      endElevation - Length; elevation at end of the clothoid
      numSegments - int; number of segments used to approximate (the number of points is one higher than this)
      Returns:
      OtsLine3d; the clothoid
      Throws:
      OtsGeometryException - if the number of segments is too low
    • clothoid

      public static OtsLine3d clothoid(OtsPoint3d start, Direction startDirection, LinearDensity endCurvature, Length length, Length endElevation, int numSegments) throws OtsGeometryException
      Approximate a clothoid with curvature 0 at start.
      Parameters:
      start - OtsPoint3d; starting point of the clothoid
      startDirection - Direction; start direction of the clothoid
      endCurvature - LinearDensity; curvature at the end of the clothoid
      length - Length; length of the clothoid
      endElevation - Length; elevation at end of the clothoid
      numSegments - int; number of segments used to approximate (the number of points is one higher than this)
      Returns:
      OtsLine3d; the clothoid
      Throws:
      OtsGeometryException - if the number of segments is too low
    • clothoid

      public static OtsLine3d clothoid(OtsPoint3d start, Direction startDirection, LinearDensity startCurvature, LinearDensity endCurvature, Length length, Length endElevation, int numSegments) throws OtsGeometryException
      Approximate a clothoid.
      Parameters:
      start - OtsPoint3d; starting point of the clothoid
      startDirection - Direction; start direction of the clothoid
      startCurvature - LinearDensity; curvature at the start of the clothoid [1/m]
      endCurvature - LinearDensity; curvature at the end of the clothoid [1/m]
      length - Length; length of the clothoid
      endElevation - Length; elevation at end of the clothoid
      numSegments - int; number of segments used to approximate (the number of points is one higher than this)
      Returns:
      OtsLine3d; the clothoid
      Throws:
      OtsGeometryException - if the number of segments is too low
    • main

      public static void main(String[] args) throws OtsGeometryException
      Demonstrate / test the clothoid methods.
      Parameters:
      args - String[]; the command line arguments (not used)
      Throws:
      OtsGeometryException - if the number of segments is too low