Click or drag to resize
CsTCB Class
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.
Inheritance Hierarchy

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class CsTCB : Spline

The CsTCB type exposes the following members.

Constructors
  NameDescription
Public methodCsTCB
Constructs the tension-continuity-bias (TCB) cubic spline interpolant to the given data points.
Top
Methods
  NameDescription
Public methodCompute
Computes the tension-continuity-bias (TCB) cubic spline interpolant.
Public methodDerivative(Double)
Returns the value of the first derivative of the spline at a point.
(Inherited from Spline.)
Public methodDerivative(Double, Int32)
Returns the value of the derivative of the spline at a point.
(Inherited from Spline.)
Public methodDerivative(Double, Int32)
Returns the value of the derivative of the spline at each point of an array.
(Inherited from Spline.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEval(Double)
Returns the value of the spline at a point.
(Inherited from Spline.)
Public methodEval(Double)
Returns the value of the spline at each point of an array.
(Inherited from Spline.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetBreakpoints
Returns a copy of the breakpoints.
(Inherited from Spline.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIntegral
Returns the value of an integral of the spline.
(Inherited from Spline.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetBias
Sets the bias values at the data points.
Public methodSetContinuity
Sets the continuity values at the data points.
Public methodSetTension
Sets the tension values at the data points.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyLeftEndTangent
The value of the tangent at the leftmost endpoint.
Public propertyRightEndTangent
The value of the tangent at the rightmost endpoint.
Top
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

See Also

Reference

Other Resources