Base for most interpolations.
Constructor | Description |
Full Usage:
CurveBase()
|
|
Instance member | Description |
Full Usage:
this.CubicSplineCoefficients
Parameters:
IReadOnlyList<float>
-
The vector (lo,hi) of data abscissa (must be strictly increasing).
y : IReadOnlyList<float>
-
The vector (lo,hi) of ordinate.
y1 : IReadOnlyList<float>
-
The vector containing the 1st derivative y'(x(i)).
y2 : IVector<float>
-
Output: the spline coefficients y2(i).
y3 : IVector<float>
-
Output: the spline coefficients y3(i).
|
Calculate the spline coefficients y2(i) and y3(i) for a natural cubic spline, given the abscissa x(i), the ordinate y(i), and the 1st derivative y1(i).
The spline interpolation can then be evaluated using Horner's rule 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).
|
Full Usage:
this.CubicSplineHorner
Parameters:
float
-
The abscissa value at which the interpolation is to be evaluated.
x : IReadOnlyList<float>
-
The vector (lo,hi) of data abscissa (must be strictly increasing).
y : IReadOnlyList<float>
-
The vectors (lo,hi) of ordinate
y1 : IReadOnlyList<float>
-
contains the 1st derivative y'(x(i))
y2 : IReadOnlyList<float>
-
contains the 2nd derivative y''(x(i))
y3 : IReadOnlyList<float>
-
contains the 3rd derivative y'''(x(i))
Returns: float
P(u) = y(i) + dx * (y1(i) + dx * (y2(i) + dx * y3(i))).
In the special case of empty data vectors (x,y) a value of 0.0 is returned.
|
Return the interpolation value P(u) for a piecewise cubic curve determined by the abscissa vector x, the ordinate vector y, the 1st derivative vector y1, the 2nd derivative vector y2, and the 3rd derivative vector y3, using the Horner scheme.
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.
|
Full Usage:
this.CubicSplineHorner1stDerivative
Parameters:
float
x : IReadOnlyList<float>
y : IReadOnlyList<float>
y1 : IReadOnlyList<float>
y2 : IReadOnlyList<float>
y3 : IReadOnlyList<float>
Returns: float
|
|
Full Usage:
this.GetCurvePoints
Parameters:
float
-
Lower bound of the drawing range.
xhi : float
-
Upper bound of the drawing range.
getresolution : ResolutionFunction
-
A delegate that must provide the points necessary to draw a smooth curve between to points.
setpoint : PointSink
-
A delegate which is called with each calculated point. Can be used to draw the curve.
|
Get curve points to draw an interpolation curve between the abscissa values xlo and xhi. It calls the virtual methods MpCurveBase::GetXOfU() and GetYOfU() to obtain the interpolation values. Note, that before method DrawCurve() can be called the method Interpolate() must have been called. Otherwise, not interpolation is available.
|
Full Usage:
this.GetXOfU
Parameters:
float
-
Curve parameter.
Returns: float
The abscissa value.
Modifiers: abstract |
Get the abscissa value in dependence on parameter u.
|
Full Usage:
this.GetYOfU
Parameters:
float
-
Curve parameter.
Returns: float
The ordinate value.
Modifiers: abstract |
Gets the ordinate value on dependence on parameter u.
|
Full Usage:
this.Interpolate
Parameters:
IReadOnlyList<float>
-
The vector of abscissa values.
y : IReadOnlyList<float>
-
The vector of ordinate values.
Modifiers: abstract |
Interpolates a curve using abcissa x and ordinate y.
|
Full Usage:
this.Parametrize
Parameters:
IReadOnlyList<float>
-
The vector of abscissa values.
y : IReadOnlyList<float>
-
The vector of ordinate values.
t : IVector<float>
-
Output: the vector of "distances".
parametrization : Parametrization
-
The parametrization rule to apply.
Modifiers: abstract |
Curve length parametrization. Returns the accumulated "distances" between the points (x(i),y(i)) and (x(i+1),y(i+1)) in t(i+1) for i = lo ... hi. t(lo) = 0.0 always.
The way of parametrization is controlled by the parameter parametrization. Parametrizes curve length using: |dx| + |dy| if parametrization = Norm1 sqrt(dx^2+dy^2) if parametrization = Norm2 (dx^2+dy^2) if parametrization = SqrNorm2 Parametrization using Norm2 usually gives the best results.
|
Static member | Description |
Full Usage:
CurveBase.FindInterval(u, x)
Parameters:
float
-
The value to search for.
x : IReadOnlyList<float>
-
Vector of (strictly increasing) x values.
Returns: int
The index i so that x[i]
|
Find index of largest element in the increasingly ordered vector x, which is smaller than u. If u is smaller than the smallest value in the vector then the lowest index minus one is returned. A fast binary search is performed. Note, that the vector must be strictly increasing.
|