# Interpolation

### Linear interpolation

Given a straight line passing through and , we wish
to calculate the position at a given
position .

Using the definition of a line,

we find that value as

which can be rewritten in the familiar form

where

and
.
### Bi-linear interpolation

This is linear interpolation in two dimensions.

See p. 126 of *Numerical Recipes in C++* for implementation detail.

### Bi-cubic interpolation

Implementation details in *Numerical Recipes in C++*.

### Geometric interpolation

Measure the physical overlap between pixels, and weight accordingly.
This requires the use of (often slow) PolygonClipping routines.

#### References

**[PTV+03]** Press, William H., Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery. *Numerical Recipes in C++: The Art of Scientific Computing*, 2003. Cambridge University Press, 2nd edition, 2003.

sahara trip
rainbow