CurveBase Type

Base for most interpolations.

Constructors

Constructor Description

CurveBase()

Full Usage: CurveBase()

Instance members

Instance member Description

this.CubicSplineCoefficients

Full Usage: this.CubicSplineCoefficients

Parameters:
    x : 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).

x : 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).

this.CubicSplineHorner

Full Usage: this.CubicSplineHorner

Parameters:
    u : 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.

u : 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.

this.CubicSplineHorner1stDerivative

Full Usage: this.CubicSplineHorner1stDerivative

Parameters:
Returns: float

u : float
x : IReadOnlyList<float>
y : IReadOnlyList<float>
y1 : IReadOnlyList<float>
y2 : IReadOnlyList<float>
y3 : IReadOnlyList<float>
Returns: float

this.GetCurvePoints

Full Usage: this.GetCurvePoints

Parameters:
    xlo : 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.

xlo : 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.

this.GetXOfU

Full Usage: this.GetXOfU

Parameters:
    u : float - Curve parameter.

Returns: float The abscissa value.
Modifiers: abstract

Get the abscissa value in dependence on parameter u.

u : float

Curve parameter.

Returns: float

The abscissa value.

this.GetYOfU

Full Usage: this.GetYOfU

Parameters:
    u : float - Curve parameter.

Returns: float The ordinate value.
Modifiers: abstract

Gets the ordinate value on dependence on parameter u.

u : float

Curve parameter.

Returns: float

The ordinate value.

this.Interpolate

Full Usage: this.Interpolate

Parameters:
Modifiers: abstract

Interpolates a curve using abcissa x and ordinate y.

x : IReadOnlyList<float>

The vector of abscissa values.

y : IReadOnlyList<float>

The vector of ordinate values.

this.Parametrize

Full Usage: this.Parametrize

Parameters:
    x : 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.

x : 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.

Static members

Static member Description

CurveBase.FindInterval(u, x)

Full Usage: CurveBase.FindInterval(u, x)

Parameters:
    u : 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.

u : float

The value to search for.

x : IReadOnlyList<float>

Vector of (strictly increasing) x values.

Returns: int

The index i so that x[i]