Package org.opentrafficsim.core.geometry
Record Class Fresnel
java.lang.Object
java.lang.Record
org.opentrafficsim.core.geometry.Fresnel
- Record Components:
c
- C value of Fresnel integrals
- S value of Fresnel integral
Utility class to create clothoid lines, in particular the Fresnel integral based on:
- W.J. Cody (1968) Chebyshev approximations for the Fresnel integrals. Mathematics of Computation, Vol. 22, Issue 102, pp. 450–453.
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:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
-
- Cody (1968) (note: tables with values not included in pdf)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
c()
Returns the value of thec
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static Fresnel
integral
(double x) Approximate the Fresnel integral.double
s()
Returns the value of thes
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
integral
Approximate the Fresnel integral. The method used is based on Cody (1968). This method applies rational approximation to approximate the clothoid. For clothoid rotation beyond 1.6 rad, this occurs in polar form. The polar form is robust for arbitrary large numbers, unlike polynomial expansion, and will at a large threshold converge to (0.5, 0.5). There are 5 regions with different fitted values for the rational approximations, in Cartesian or polar form.
W.J. Cody (1968) Chebyshev approximations for the Fresnel integrals. Mathematics of Computation, Vol. 22, Issue 102, pp. 450–453.- Parameters:
x
- length along the standard Fresnel integral (no scaling).- Returns:
- array with two double values c and s
- See Also:
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
c
public double c()Returns the value of thec
record component.- Returns:
- the value of the
c
record component
-
s
public double s()Returns the value of thes
record component.- Returns:
- the value of the
s
record component
-