## 2-D Interpolation

Interpolation can also be carried out in 2-D space. Given a set of sample points at 2-D points in either a regular grid or an irregular grid (scattered data points), we can construct an interpolating function that passes through all these sample points. Here we will first consider methods based only on regular grids and then those that also work for irregular grids.

Methods based on sample points in regular grid

• Bilinear Interpolation

Given a set of 2-D sample points in a regular grid, we can use the methods of bilinear and bicubic 2-D interpolation to obtain the value of the interpolating function at any point inside each of the rectangles in a 2-D grid with the four corners at , , , and . In the following, for convenience and without loss of generality, we only consider one of such rectangles with , and define , , , and .

First recall that at any point in the 1-D interval can be approximated by linear interpolation based on and :

 i.e.

This method of 1-D linear interpolation can be extended to the bilinear interpolation method to calculate the function value at any 2-D point with and based on the known sample values , , , and at the four corners of the rectangle in a 2-D grid. This is carried out in the following two steps:

• Linear interpolation in x-dimension:

• Linear interpolation in y-dimension:
 (98)

As the final expression for the bilinear interpolation is symmetric with respect to and , the order of the two steps is irrelevant, i.e., if the interpolation is first carried out in y-direction and then in x-direction, the result is exactly the same.

• Bicubic Interpolation

The same set of 2-D sample points can be more smoothly approximated by a bicubic function in the following form:

where the 16 weights can be found by assuming that at the four corners , , and of the rectangle in which resides, and have the same partial derivative values as well as function values:

These 16 equations can be expressed in matrix form as:

Solving this linear system of 16 equations, we get the 16 weights in the bicubic model of the function:

Methods based on sample points in irregular grid

The methods discussed above require the data points to be available on a regular (rectangular) grid. They do not work if the data points are hileramdomly scattered in the 2-D space (irregular grid). We now discuss methods that work for both regular and irregular grids.

A radial basis function (RBF) is any function that is centrally symmetric with respect to a specific point , i.e., the value of the RBF at any 2-D point can be simply represented by , as a function of the distance between the point and . Typical RBFs include the Gaussian and Butterworth functions:

where is a parameter that controls the width of the RBF. By adjusting we can achieve the desired smoothness of the interpolating function based on the density of the scatter data points (average distance between any two points). The parameter in the Butterworth function is the order of the function which controls the shape of the function

Based on a given RBF , we can construct an interpolating function as the weighted sum of such RBFs each centered around one of the given sample points :

Here the weights are determined based on the requirement that the interpolating function takes the same value as the sample point at each of the positions:

Solving this equation system of linear equations with coefficients , we get the weights and thereby the interpolation function .

• Shepards method

In this method, the value of the interpolating function at any 2-D point is calculated as the weighted average of all available sample points:

where is the weight function that is inversely proportional the pth power of the distance between and , and normalized:

so that . Here the parameter controls the rate of decay of as the distance becomes greater. Similar to the parameter in the RBF method, here can also be adjusted according the density of the sample points to control the smoothness of the interpolating function .

In particular, at any sample point , we have

and

we therefore get

i.e., the interpolating function is guaranteed to go through every sample point. Note that in code realization, care needs to be taken to aviod the issue of “devide by zero”.

The weight function can be generalized to any RBF function centrally symmetric with respect to , such as the Gaussian or Butterworth fucntions considered above:

which can then be normalized as before. Here we also need to guarantee that the resulting interpolating function passes all given sample points, i.e., for all . To do so, we can set (a very large number in practicd) when , so that . and for all .