Click or drag to resize

CurveBaseCubicSplineHorner Method

Return the interpolation value P(u) for a piecewise cubic curve determined by the abscissa vector x, the ordinate vector y, and derivative coefficient vectors y1, y2, and y3, using the Horner scheme.

Namespace: Altaxo.Calc.Interpolation
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntax
C#
public double CubicSplineHorner(
	double u,
	IReadOnlyList<double> x,
	IReadOnlyList<double> y,
	IReadOnlyList<double> y1,
	IReadOnlyList<double> y2,
	IReadOnlyList<double> y3
)

Parameters

u  Double
The abscissa value at which the interpolation is to be evaluated.
x  IReadOnlyListDouble
The vector (lo,hi) of data abscissa (must be strictly increasing).
y  IReadOnlyListDouble
The vectors (lo,hi) of ordinate
y1  IReadOnlyListDouble
Contains the 1st derivative y'(x(i)).
y2  IReadOnlyListDouble
Contains the 2nd derivative y''(x(i)).
y3  IReadOnlyListDouble
Contains the 3rd derivative y'''(x(i)).

Return Value

Double
The interpolated value P(u). If x is empty, returns 0.0.
Remarks
C#
All vectors must have conformant dimenions.
The abscissa x(i) values must be strictly increasing.


This subroutine evaluates the function

   P(u) = y(i) + dx * (y1(i) + dx * (y2(i) + dx * y3(i)))

where  x(i) <= u < x(i+1) and dx = u - x(i), using Horner's rule

   lo <= i <= hi is the index range of the vectors.
   if  u <  x(lo) then  i = lo  is used.
   if  u <= x(hi) then  i = hi  is used.

   A fast binary search is performed to determine the proper interval.
See Also