Linear Interpolation Article Index for
Linear
Website Links For
Linear
 

Information About

Linear Interpolation




Lerp is a quasi-acronym for ''linear interpolation'', which can also be used as a verb .


LINEAR INTERPOLATION BETWEEN TWO KNOWN POINTS


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

: rac{y - y_0}{y_1 - y_0} = rac{x - x_0}{x_1 - x_0}

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 + (x-x_0) rac{y_1 - y_0}{x_1-x_0}

which is the formula for linear interpolation in the interval \scriptstyle(x_0,x_1). Outside this interval, the formula is identical to Linear Extrapolation .


INTERPOLATION OF A DATA SET


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


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(x) - p(x) \,\!

where ''p'' denotes the linear interpolation Polynomial defined above

:p(x) = f(x_0) + rac{f(x_1)-f(x_0)}{x_1-x_0}(x-x_0). \,\!

It can be proven using Rolle's Theorem that if ''f'' has two continuous derivatives, the error is bounded by