Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

InterpolatorCubicSpline Class Reference

#include <Interpolator.h>

Inheritance diagram for InterpolatorCubicSpline:

Inheritance graph
[legend]
Collaboration diagram for InterpolatorCubicSpline:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InterpolatorCubicSpline (unsigned int dim, unsigned int num_samples=3)
void Eval (float t, T *value)
void ComputeTangents (unsigned int i)

Detailed Description

Cubic Spline Interpolator.

The cubic spline interpolator uses 2 points P_0, P_1 and their respective tangents/derivatives T_0, T_1 to build a third order interpolation polynomial which is usually very smooth, and much better than simple cubic interpolation without tangent information.

The derivatives can be passed by the user together with the samples, or computed by numerical differentiation byt the method ComputeTangents() using:

T_i = a*(P_i+1 - P_i-1)

Where a = 0.5 generates Catmull-Rom splines.

The first and last points' derivatives cannot be intialized this way, their value is set to 0.


Constructor & Destructor Documentation

InterpolatorCubicSpline::InterpolatorCubicSpline unsigned int  dim,
unsigned int  num_samples = 3
[inline]
 

Constructor: num_samples must be >= 3


Member Function Documentation

void InterpolatorCubicSpline::ComputeTangents unsigned int  i  )  [inline, virtual]
 

Virtual method to compute/guess the tangent of the new added i-th sample.

MUST be redefined by subclasses that use tangents in order to properly initialize unspecified tangents.

MAY change the tangents of previous samples using the new i-th sample information.

[OSCAR] Currently used for splines only

Reimplemented from Interpolator.

void InterpolatorCubicSpline::Eval float  t,
T *  value
[inline, virtual]
 

Evaluates the function in t using the specific interpolation method (defined in a subclass).

Implements Interpolator.


The documentation for this class was generated from the following file:
Generated on Tue Aug 10 15:58:30 2004 for Saphyre2 by doxygen 1.3.5