# Linear interpolation

Linear interpolation is a method of curve fitting using linear polynomials. It is heavily employed in mathematics (particularly numerical analysis), and numerous applications including computer graphics. It is a simple form of interpolation.

Lerp is a quasi-acronym for "linear interpolation", which can also be used as a verb harv|Raymond|2003.

Linear interpolation between two known points

If the two known points are given by the coordinates $scriptstyle\left(x_0,y_0\right)$ and $scriptstyle\left(x_1,y_1\right)$, the linear interpolant is the straight line between these points. For a value "x" in the interval $scriptstyle\left(x_0, x_1\right)$, the value "y" along the straight line is given from the equation

:$frac\left\{y - y_0\right\}\left\{y_1 - y_0\right\} = frac\left\{x - x_0\right\}\left\{x_1 - x_0\right\}$

which can be derived geometrically from the figure on the right.

Solving this equation for "y", which is the unknown value at "x", gives

:$y = y_0 + \left(x-x_0\right)frac\left\{y_1 - y_0\right\}\left\{x_1-x_0\right\}$

which is the formula for linear interpolation in the interval $scriptstyle\left(x_0,x_1\right)$. Outside this interval, the formula is identical to linear extrapolation.

Interpolation of a data set

Linear interpolation on a set of data points $scriptstyle\left(x_0, y_0\right),, \left(x_1, y_1\right),,dots,,\left(x_n, y_n\right)$ is defined as the concatenation of linear interpolants between each pair of data points. This results in a continuous curve, with a discontinuous derivative, thus of differentiability class $C^0$.

Linear interpolation as approximation

Linear interpolation is often used to approximate a value of some function "f" using two known values of that function at other points. The "error" of this approximation is defined as

:$R_T = f\left(x\right) - p\left(x\right) ,!$

where "p" denotes the linear interpolation polynomial defined above

:$p\left(x\right) = f\left(x_0\right) + frac\left\{f\left(x_1\right)-f\left(x_0\right)\right\}\left\{x_1-x_0\right\}\left(x-x_0\right). ,!$

It can be proven using Rolle's theorem that if "f" has a continuous second derivative, the error is bounded by

:$|R_T| leq frac\left\{\left(x_1-x_0\right)^2\right\}\left\{8\right\} max_\left\{x_0 leq x leq x_1\right\} |f"\left(x\right)|. ,!$

As you see, the approximation between two points on a given function gets worse with the second derivative of the function that is approximated. This is intuitively correct as well: the "curvier" the function is, the worse is the approximations made with simple linear interpolation.

Applications

Linear interpolation is often used to fill the gaps in a table. Suppose you have a table listing the population of some country in 1970, 1980, 1990 and 2000, and that you want to estimate the population in 1994. Linear interpolation gives you an easy way to do this.

The basic operation of linear interpolation between two values is so commonly used in computer graphics that it is sometimes called a lerp in that field's jargon. The term can be used as a verb or noun for the operation. e.g. "Bresenham's algorithm lerps incrementally between the two endpoints of the line."

Lerp operations are built into the hardware of all modern computer graphics processors. They are often used as building blocks for more complex operations: for example, a bilinear interpolation can be accomplished in two lerps. Because this operation is cheap, it's also a good way to implement accurate lookup tables with quick lookup for smooth functions without having too many table entries.

Extensions

Accuracy

If a "C0" function is insufficient, for example if the process that has produced the data points is known be smoother than "C0", it is common to replace linear interpolation with spline interpolation, or even polynomial interpolation in some cases.

Multivariate

Linear interpolation as described here is for data points in one spatial dimension. For two spatial dimensions, the extension of linear interpolation is called bilinear interpolation, and in three dimensions, trilinear interpolation. Other extensions of linear interpolation can be applied to other kinds of mesh such as triangular and tetrahedral meshes.

History

Linear interpolation has been used since antiquity for filling the gaps in tables, often with astronomical data. It is believed that it was used by Babylonian astronomers and mathematicians in Seleucid Mesopotamia (last three centuries BC), and by the Greek astronomer and mathematician, Hipparchus (second century BC). A description of linear interpolation can be found in the "Almagest" (second century AD) by Ptolemy.

References

*.
*.

ee also

* Bilinear interpolation
* de Casteljau's algorithm

External links

* [http://www.cut-the-knot.org/Curriculum/Calculus/StraightLine.shtml Equations of the Straight Line] at cut-the-knot

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• linear interpolation — tiesinė interpoliacija statusas T sritis fizika atitikmenys: angl. linear interpolation vok. lineare Interpolation, f rus. линейная интерполяция, f pranc. interpolation linéaire, f …   Fizikos terminų žodynas

• linear interpolation — A technique used in discounted cash flow for calculating the approximate internal rate of return of a project. The cash flows for the project are discounted at two discount rates to obtain a small positive and a small negative net present value.… …   Accounting dictionary

• linear interpolation — noun Date: 1965 estimation of a function (as a logarithm) by assuming that it is a straight line between known values …   New Collegiate Dictionary

• linear interpolation method — tiesinės interpoliacijos metodas statusas T sritis fizika atitikmenys: angl. linear interpolation method; method of proportional parts vok. lineare Interpolationsmethode, f rus. метод линейной интерполяции, m pranc. méthode d’interpolation… …   Fizikos terminų žodynas

• Interpolation search — is an algorithm for searching for a given key value in an indexed array that has been ordered by the values of the key. It parallels how humans search through a telephone book for a particular name, the key value by which the book s entries are… …   Wikipedia

• Interpolation — In the mathematical subfield of numerical analysis, interpolation is a method of constructing new data points within the range of a discrete set of known data points. In engineering and science one often has a number of data points, as obtained… …   Wikipedia

• Linear — The word linear comes from the Latin word linearis , which means created by lines .In advanced mathematics, a linear map or function f ( x ) is a function which satisfies the following two properties:* Additivity (also called the superposition… …   Wikipedia

• Interpolation — A method of estimating an unknown price or yield of a security. This is achieved by using other related known values that are located in sequence with the unknown value. Interpolation is most often used in situations where a table of values is… …   Investment dictionary

• interpolation linéaire — tiesinė interpoliacija statusas T sritis fizika atitikmenys: angl. linear interpolation vok. lineare Interpolation, f rus. линейная интерполяция, f pranc. interpolation linéaire, f …   Fizikos terminų žodynas

• Linear programming — (LP, or linear optimization) is a mathematical method for determining a way to achieve the best outcome (such as maximum profit or lowest cost) in a given mathematical model for some list of requirements represented as linear relationships.… …   Wikipedia

### Share the article and excerpts

##### Direct link
Do a right-click on the link above
and select “Copy Link”

We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.