WebCab Functions Web Services for .NET v2.0

Interpolation.InterpolateExtrapolatePolynomial Method 

Interpolates (or extrapolates) a given polynomial (with associated error estimate) in one variable using a polynomial of degree n-1 when we are provided with n interpolation points.

public double[] InterpolateExtrapolatePolynomial(
   double[] tabulationPointsInX,
   double[] polynomialValues,
   double interpolationPoint
);

Parameters

tabulationPointsInX
An array of doubles for which at member we know the corresponding value of the given polynomial. Note, that the corresponding values of the polynomial at these points given by the member of the array yCoordinates which lie in the corresponding position.
polynomialValues
An array of doubles which corresponds to the value of the polynomial at the points tabulationPointsInX. The first point of this array is the value of the given polynomial evaluated at the point tabulationPointsInX[0], th second point of the array is the value of the given polynomial at the point tabulationPointsInX[1].
interpolationPoint
The value of the point at which the interpolation function is evaluated and a corresponding error estimate is given.

Return Value

Returns an array of two values the first being the value of the interpolation function evaluated at the interpolation point and the other being the error estimate.

Remarks

If P(x) is the polynomial of degree n-1 such that P(xCoordinates[i]) = yCoordinates[i]; i=0,...,n-1; then if the desired point at which the interpolation functions value is required is interpolationPoint. Then the returned value will be some double value y, where y = P(interpolationPoint).

Remark: If either of the arrays tabulationPointsInX or polynomialValues, have differing lengths then the length of the shorter array will be taken as reference. In this case the number of interpolation points used will correspond to the length of the shorter array where the elements of the longer array with a higher index being ignored.

Exceptions

Exception TypeCondition
InterpolationExceptionThrown when the input values do not meet the requirements mentioned above.

See Also

Interpolation Class | Interpolation Namespace