Interpolation is used to approximate a function for which we only know values for a discrete set of values of the independent variable. For example, suppose we have a table like
We immediately recognize that f(X) can be fitted by the function X2 but in general this is not the case when we want to interpolate. Suppose we would like the value of f(X) which corresponds to X = 1.7. The following formula demonstrates how we would interpolate (linearly) between the values for X = 1 and X = 2.
- f(1.7) = f(1) + [(1.7-1)/(2-1)]*(f(2)-f(1)) = 1 + 0.7*(4-1) = 1 + .7*3 = 3.1
Also see polynomial interpolation.