Core 1.0
Public Member Functions | Protected Attributes | List of all members
Clothoid2 Class Reference

Clothoid curves. More...

#include <clothoid.h>

Public Member Functions

 Clothoid2 ()
 Empty constructor. More...
 
 Clothoid2 (const double &)
 Create a clothoid given a slope multiplier parameter. More...
 
 Clothoid2 (const double &, const double &)
 Create a clothoid with one pair of parameters. More...
 
 Clothoid2 (const double &, const double &, const double &, const double &)
 Create a clothoid given two pairs of parameters. More...
 
 ~Clothoid2 ()
 Empty.
 
Vector2 Vertex (const double &) const
 Compute the point of the clothoid curve at parameter curvilinear abscissa t. More...
 
double Curvature (const double &) const
 Compute the curvature of the clothoid at curvilinear abscissa t. More...
 
Vector2 Tangent (const double &) const
 Compute the tangent to the clothoid at curvilinear abscissa t. More...
 
double GetSlope () const
 Return the slope of the clothoid.
 
void Draw (QGraphicsScene &, const QPen &, const QBrush &) const
 Draw the clothoid arc. More...
 

Protected Attributes

double B
 Slope parameter.
 

Detailed Description

Clothoid curves.

An clothoid, also referred to as Euler spiral, is a curve whose curvature changes linearly with its curve length (the curvature of a circular curve is equal to the reciprocal of the radius).

See Sketching piecewise clothoid curves, Sketch-Based Interfaces and Modeling, 2008.

Author
Eric Guérin

Constructor & Destructor Documentation

◆ Clothoid2() [1/4]

Clothoid2::Clothoid2 ( )

Empty constructor.

Set slope to 1.0/Pi.

◆ Clothoid2() [2/4]

Clothoid2::Clothoid2 ( const double &  slope)
explicit

Create a clothoid given a slope multiplier parameter.

Parameters
slopeSlope.

◆ Clothoid2() [3/4]

Clothoid2::Clothoid2 ( const double &  a,
const double &  ca 
)
explicit

Create a clothoid with one pair of parameters.

Parameters
aCurvilinear abscissa of the point.
caCurvature.

◆ Clothoid2() [4/4]

Clothoid2::Clothoid2 ( const double &  a,
const double &  ca,
const double &  b,
const double &  cb 
)
explicit

Create a clothoid given two pairs of parameters.

Parameters
a,bCurvilinear abscissa of the two points.
ca,cbCurvature of the two points.

Member Function Documentation

◆ Curvature()

double Clothoid2::Curvature ( const double &  t) const
inline

Compute the curvature of the clothoid at curvilinear abscissa t.

By definition the curvature of the clothoid is a linear function of t defined as c(t)=t/B.

Parameters
tCurvilinear abscissa.

◆ Draw()

void Clothoid2::Draw ( QGraphicsScene &  scene,
const QPen &  pen,
const QBrush &  brush 
) const

Draw the clothoid arc.

Parameters
sceneGraphics scene.
penThe pen.
brushThe brush.

◆ Tangent()

Vector2 Clothoid2::Tangent ( const double &  t) const

Compute the tangent to the clothoid at curvilinear abscissa t.

It is defined as Pi*B*(cos(Pi/2*t^2),sin(Pi/2*t^2))

Parameters
tparameter

◆ Vertex()

Vector2 Clothoid2::Vertex ( const double &  t) const

Compute the point of the clothoid curve at parameter curvilinear abscissa t.

The implementation relies on a rational approximation.

M. Heald. Rational approximations for the fresnel integrals. Mathematics of Computation, 44 (170), 459–461, 1985.

Parameters
tParameter.