WebCab Functions for .NET v2.0

Interpolation.BicubicInterpolation Method (Double[], Double[], Double[], Double[], Double, Double, Double, Double, Double, Double)

Evaluates the value and derivatives parallel to the axis of the grid cell of the bicubic interpolation evaluated at a given point.

public double[] BicubicInterpolation(
   double[] function,
   double[] derivatives1stDirection,
   double[] derivatives2ndDirection,
   double[] crossDerivatives,
   double direction1LowerGridPoint,
   double direction1UpperGridPoint,
   double direction2LowerGridPoint,
   double direction2UpperGridPoint,
   double direction1,
   double direction2
);

Parameters

function
An array of four doubles which represent the value of the bicubic interpolated function at the four grid cell corners. Note, that values should be recorded in the array by reading the coordinate points in anti-clockwise order (see the PDF for further details), that is in the following order bottom left, bottom right, top left and then top right.
derivatives1stDirection
An array of four doubles which are the derivatives at the bottom left, bottom right, top left and top right grid cell corner points of the interpolated function in the 1st direction.
derivatives2ndDirection
An array of four doubles which are the derivatives at the four grid cell corner points of the interpolated function in the 2nd direction.
crossDerivatives
An array of four doubles containing the cross derivatives at the four grid cell corner points.
direction1LowerGridPoint
The lower coordinate of the grid rectangle in the 1st direction.
direction1UpperGridPoint
The upper coordinate of the grid rectangle in the 1st direction.
direction2LowerGridPoint
The lower coordinate of the grid rectangle in the 2nd direction.
direction2UpperGridPoint
The upper coordinate of the grid rectangle in the 2nd direction.
direction1
The value of the coordinate in the 1st direction for which the value of the interpolation function will be evaluated and the corresponding error estimate will be given. In the example given above this is the value 3.7.
direction2
The value of the coordinate in the 2nd direction for which the value of the interpolation function will be evaluated and the corresponding error given. In the example given above this is the value 4.8.

Return Value

a 2-dimensional array of length 4 which is populated in accordance with the convention described above which contains the coefficients of the bicubic interpolation polynomials coefficients.

Remarks

We return an array of length 3, where the first term is the value at a given point of the bicubic interpolation function; the second and third terms are the derivatives of the bicubic interpolation function evaluated at the same given point in the directions parallel to the grid axis over which the bicubic interpolation function is constructed (see discussion below for further explanation).

Information required and Comparison with BicubicInterpolation(double[][], ...)

This method requires that the bicubic interpolation is known on a grid of points which are spanned by two independent vectors parallel to the grid cell's axis. By known we mean that the value, derivative in each of the grid axis directions and cross derivative is know at each of the four grid points. From this information we are able to construct the bicubic interpolation polynomial from which its values and derivatives are evaluated. This differs from BicubicInterpolation(double[][], ...) which requires that the coefficients of the bicubic interpolation polynomial are given, which can be evaluated using BicubicCoefficients which leads to the bicubic interpolation polynomial from which again we are able to evaluate the interpolation polynomials value and its derivatives.

In instances when the bicubic interpolation functions value and derivatives are only required at one point then this method, is equivalent in terms of speed to the application of BicubicCoefficients, followed by BicubicInterpolation(double[][], ...). However, in cases where the value and derivatives are required at many points then the application of BicubicCoefficients once, followed be repeated calls to BicubicInterpolation(double[][], ...), will be more efficient than the same information evaluated using repeated calls to this method. The reason for this is that this method will require that the bicubic interpolation polynomial is constructed for each point at which the value and derivatives of the bicubic interpolation polynomial are desired. Where as the other approach will only require that the bicubic interpolation polynomial is only constructed once via evaluation of its coefficients (using BicubicCoefficients), however many points values are read off using BicubicInterpolation(double[][], ...).

Providing the data and indexing

The information about the cubic interpolation polynomial at the four grid points needs to be provided to the methods as parameters in accordance with the indexing outlined in the example given below.

Example illustrating this Method Application and Parameters:

We provide the example below in order to illustrate the use of this method in a sufficiently explicit form as to allow you to be able to directly abstract the nature the methods and the parameters used to your particular situation.

A typical example is when we require to know the value of a function in the coordinate pane at the point (3.7, 4.8); when the function itself is known on a grid which consists of coordinates with for example integer values (i.e. (0,0), (1,0), (0,1), (1,1) and so on...). Firstly, with respect to this method when we refer to the function being known, we refer to the fact that we know the functions values on the grid points, its derivatives on the grid points in the two directions spanning the grid and the cross derivatives in the two direction at the grid points are known values.

Assuming we have such an instance and we consider in two dimensional Euclidean coordinate space a (sufficiently smooth) function. We wish to find the value of the Bicubic interpolation of this given function at the point (3.7, 4.8) and return an estimate of the error. The coordinate space on which the function has been given has been tabulated with respect to a rectangular grid with the vertices of this grid lying on coordinate points with integer values (i.e. (0,0), (1,0), (0,1, (1,1) and so on...). If we are considering the particular interpolation point (3.7, 4.8), then in order to evaluated the interpolation function at a given point using this method we will need to provide the following parameters:


The Grid Points and DirectionsThe known information about the given functionRemarks:

See Also

Interpolation Class | WebCab.Libraries.Math.Interpolation Namespace | Interpolation.BicubicInterpolation Overload List