Evaluates the value and derivatives parallel to the axis of the grid cell of the bicubic interpolation evaluated at a given point.
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.
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).
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[][], ...).
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.
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:
direction1 - the direction in the x-axis and has a value of 3.7
direction2 - the direction in the y-axis and has a value of 4.8
direction1LowerGridPoint - the coordinate of the lower coordinate of
the grid square in the 1st direction is 3
direction1UpperGridPoint - the coordinate of the upper coordinate of
the grid square in the 1st direction is 4
direction2LowerGridPoint - the coordinate of the lower coordinate of
the grid square in the 2nd direction is 4
direction2UpperGridPoint - the coordinate of the lower coordinate of
the grid square in the 2nd direction is 5
functionValues[] - an array of length four which contains the values of
the function you wish to interpolate at the points (3,4), (4,4), (4,5), (3,5).
Given in exactly the same order within the array, i.e. functionValues[0] = f(3,4),
functionValues[1] = f(4,4), and so on where the function being interpolated is f.
derivatives1stDirection[] - an array of length four which contains the
values of the derivative of the function at the points (3,4), (4,4), (4,5),
(3,5); in the 1st direction in this case the direction parallel to the x-axis.
Note that we know that the 1st direction is parallel to the x-axis (rather
the y-axis) because of the order in which the functionValues are ordered.
derivatives2ndDirection[] - the value of the derivative of the function at the
points (3,4), (4,4), (4,5), (3,5); in the 2nd direction which in this case
is the direction parallel to the y-axis.
crossDerivatives[] - an array of length four which contains the values of
the cross derivatives at the four points (3,4), (4,4), (4,5), (3,5); where the
cross derivative is constructed by differentiating in the 1st direction (i.e.
x-axis) and then in the 2nd direction (i.e. y-axis).
Interpolation Class | Interpolation Namespace | Interpolation.BicubicInterpolation Overload List