Package org.opentrafficsim.core.geometry
Class Clothoid
- java.lang.Object
-
- org.opentrafficsim.core.geometry.Clothoid
-
public final class Clothoid extends java.lang.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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Nov 2, 2015
- Author:
- M. Dupuis @ VIRES GmbH, Alexander Verbraeck, Peter Knoppers
-
-
Method Summary
All Methods Static Methods Concrete Methods 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(java.lang.String[] args)
Demonstrate / test the clothoid methods.
-
-
-
Method Detail
-
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 clothoidstartDirection
- Direction; start direction of the clothoidendCurvature
- double; curvature at the end of the clothoid [1/m]length
- Length; length of the clothoidendElevation
- Length; elevation at end of the clothoidnumSegments
- 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 clothoidstartDirection
- Direction; start direction of the clothoidstartCurvature
- 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 clothoidendElevation
- Length; elevation at end of the clothoidnumSegments
- 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 clothoidstartDirection
- Direction; start direction of the clothoidendCurvature
- LinearDensity; curvature at the end of the clothoidlength
- Length; length of the clothoidendElevation
- Length; elevation at end of the clothoidnumSegments
- 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 clothoidstartDirection
- Direction; start direction of the clothoidstartCurvature
- 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 clothoidendElevation
- Length; elevation at end of the clothoidnumSegments
- 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(java.lang.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
-
-