In mathematics, linear interpolation (sometimes lerp) is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points.
Linear interpolation between two known points
If the two known points are given by the coordinates ( x 0 , y 0 ) {\displaystyle (x_{0},y_{0})} and ( x 1 , y 1 ) {\displaystyle (x_{1},y_{1})} , the linear interpolant is the straight line between these points. For a value x {\displaystyle x} in the interval ( x 0 , x 1 ) {\displaystyle (x_{0},x_{1})} , the value y {\displaystyle y} along the straight line is given from the equation of slopes
y − y 0 x − x 0 = y 1 − y 0 x 1 − x 0 , {\displaystyle {\frac {y-y_{0}}{x-x_{0}}}={\frac {y_{1}-y_{0}}{x_{1}-x_{0}}},}
which can be derived geometrically from the figure on the right. It is a special case of polynomial interpolation with n = 1 {\displaystyle n=1} . Solving this equation for y {\displaystyle y} , which is the unknown value at x {\displaystyle x} , gives
… excerpt ends here. Continue reading the full article.






