Classes representing continuously connected functions (splines) and some interpolation algorithms.
Include the following at the top of any translation unit that uses geometry functions or classes.
You will also need to link to -lecl_geometry.
The CubicSpline has a relatively simple c++ interface.
The blueprints generate a cubic spline over a data set. Depending on the input constraints, the spline is generated rather differently. These can be accessed via static methods in the blueprint factory (ecl::BluePrintFactory< CubicSpline >) inherited by the CubicSpline class. For example:
Access allows you to calculate the value of the spline at any point on its domain:
Streaming will provide an algebraic list of the cubic polynomials constituting the spline.
The SmoothLinearSpline simply linearly connects waypoints and adds a quintic polynomial curve to smooth the corners between each linear section. The shape of these corners is parameterised by a maximum curvature (acceleration) parameter.
Simply pass suitable x and y data sets along with a maximum curvature constraint parameter to the spline's constructor. Be sure to catch an exception if the construction should fail (this will occur if the maximum curvature constraint cannot be met).
Access and streaming is similar to that for the cubic spline.
The TensionSpline represents a mathematically parameterised spline that portrays the whole family of splines from linearly connected segments through to cubic polynomials. To do this it uses the tension function. When connecting tension functions across a series of waypoints, the tension parameter provides this extra flexibility in controlling the shape of the spline.
Note that its primary advantages are that it is still C2 continuous and it is very easy to modify the resulting behaviour through tweaking of a single parameter.
There is currently only one blueprint (though variations are not difficult to create). It is very similar to the natural cubic spline (assumes zero boundary conditions for the second derivatives), the only difference being the addition of the tension parameter.
Access and streaming is similar to that for the cubic spline.
- src/test/polynomials.cpp - src/test/cubic_splines.cpp - src/test/smooth_linear_splines.cpp - src/test/tension_function.cpp - src/test/tension_splines.cpp
- <b>Jul 09</b> : ecl::SmoothLinearSpline is a a smoothed, linearly blend spline (with quintics). - <b>May 09</b> : ecl::blueprints::C2TensionSpline is a c2 continuous tension spline interpolation. - <b>May 09</b> : ecl::TensionSpline is a representation for a tension spline. - <b>May 09</b> : ecl::TensionFunction is a representation for a tension function. - <b>May 09</b> : ecl::blueprints::C2CubicSpline is a special case of the C2CubicSpline, the natural cubic spline. - <b>May 09</b> : ecl::blueprints::C2CubicSpline is a blueprint for C2 continous splines over a set of data. - <b>May 09</b> : ecl::blueprints::DerivativeHeuristicCubicSpline uses an automated velocity based heuristic to generate a cubic spline on a data set. - <b>May 09</b> : ecl::BluePrintFactory<CubicSpline> is a blueprint factory for cubic splines. - <b>May 09</b> : ecl::CubicSpline is a typedef'd representation for a cubic spline.