Extension of the Spline class to handle a tension-continuity-bias (TCB) cubic spline, also known as a Kochanek-Bartels spline and is a generalization of the Catmull-Rom spline.

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
[SerializableAttribute]
public class CsTCB : Spline
Visual Basic (Declaration)
<SerializableAttribute> _
Public Class CsTCB _
	Inherits Spline
Visual C++
[SerializableAttribute]
public ref class CsTCB : public Spline

Remarks

Let x=xData, y=yData, and n = the length of xData and yData. Class CsTCB computes the Kochanek-Bartels spline, a piecewise cubic Hermite spline interpolant to the set of data points {\{x_i, y_i\}} for i = 0, \ldots, n-1. The breakpoints of the spline are the abscissas. As with all of the univariate interpolation functions, the abscissas need not be sorted.

The \{x_i\} values are the knots, so the i-th interval is [x_i, x_{i+1}]. (To simplify the explanation, it is assumed that the data points are given in increasing order.) The cubic Hermite in the i-th segment has a starting value of y_i and an ending value of y_{i+1}. Its incoming tangent is


            DS_i = \frac{1}{2}(1-t_i)(1-c_i)(1+b_i)\frac{y_i-y_{i-1}}{x_{i+1}-x_i}+\frac{1}{2}(1-t_i)(1+c_i)(1-b_i)\frac{y_{i+1}-y_i}{x_{i+1}-x_i}

where t_i is the i-th tension value, c_i is the i-th continuity value, and b_i is the i-th bias value. Its outgoing tangent is


            DD_i = \frac{1}{2}(1-t_i)(1+c_i)(1+b_i)\frac{y_i-y_{i-1}}{x_{i+1}-x_i}+\frac{1}{2}(1-t_i)(1-c_i)(1-b_i)\frac{y_{i+1}-y_i}{x_{i+1}-x_i}

The value of the tangent at the left endpoint is given as:

 \frac{y_0-y_{-1}}{x_1-x_0}

The value of the tangent at the right endpoint is given as:

 \frac{y_n-y_{n-1}}{x_n-x_{n-1}}

By default the values of the tangents at the leftmost and rightmost endpoints are zero. These values can be reset via the LeftEndTangent and RightEndTangent properties.

The spline has a continuous first derivative (C^{-1}) if at each data point the left and right tangents are equal. This is true if the continuity parameters, c_i, are all zero. For any values of the parameters the spline is continuous (C^{0}).

If t_i = c_i = b_i = 0 for all i, then the curve is the Catmull-Rom spline.

The following chart shows the same data points interpolated with different parameter values. All of the tension, continuity, and bias parameters are zero except for the labeled parameter, which has the indicated value at all data points.

Tension controls how sharply the spline bends at the data points. The tension values can be set via the SetTension method. If tension values are near +1, the curve tightens. If the tension values are near -1, the curve slackens.

The continuity parameter controls the continuity of the first derivative. The continuity values can be set via the SetContinuity method. If the continuity value is zero, the spline's first derivative is continuous, so the spline is C^{-1}.

The bias parameter controls the weighting of the left and right tangents. If zero, the tangents are equally weighted. If the bias parameter is near +1, the left tangent dominates. If the bias parameter is near -1, the right tangent dominates. The bias values can be set via the SetBias method.

Data Points interpolated with Different Parameter Values

Inheritance Hierarchy

See Also