The following describes perhaps the simplest method of "smoothly" approximating height values on a surface given a collection of randomly distributed samples. It is often used to derive estimates of the surface height at the vertices of a regular grid from irregularly spaced samples. While the example given here is based on determining the height of a surface (x,y), the same general technique can be used in higher dimensions. For example, estimating the density with a volume (x,y,z) given irregular density measurements.
Consider N height samples, that is, we have N triples (xi, yi,zi). We want to estimate the height z given a position on the plane (x,y). The general form of the so called "nearest neighbour weighted interpolation" also sometimes called the "inverse distance method" for estimating z is given by the following.

where p generally determines relative importance of distant samples. Note the denominator above gives a measure of how close the point being estimated is from the samples. Naturally if a sample is close then it has a greater influence on the estimate than if the sample is distant.
|
The following shows an example of reconstructing a surface from
1000 samples. The approximation is generally better with increased
values of p.
The original surface from which samples are taken for this example is shown on the right. |
|
| p = 1 |
|
| p = 2 |
|
| p = 4 |
|
| p = 6 |
|