Lerp is a quasi-acronym for linear interpolation, which can also be used as a verb .
If the two known points are given by the coordinates and , the linear interpolant is the straight line between these points. For a value x in the interval , the value y along the straight line is given from the equation
which can be derived geometrically from the figure on the right.
Solving this equation for y, which is the unknown value at x, gives
which is the formula for linear interpolation in the interval . Outside this interval, the formula is identical to linear extrapolation.
Linear interpolation on a set of data points 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 .
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
where p denotes the linear interpolation polynomial defined above
It can be proven using Rolle's theorem that if f has a continuous second derivative, the error is bounded by
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.
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.
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.
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.
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.
Agency Reviews Patent Application Approval Request for "Compensated Linear Interpolation of Capacitive Sensors of Capacitive Touch Screens"
Sep 19, 2013; By a News Reporter-Staff News Editor at Politics & Government Week -- A patent application by the inventors Cormier, JR., Ronald...
US Patent Issued to National Taiwan University on June 7 for "Non-Linear Interpolation Circuit, Interpolation Current Generating Circuit Thereof and Method for Converting Digital Data into Analog Data" (Taiwanese Inventors)
Jun 10, 2011; ALEXANDRIA, Va., June 10 -- United States Patent no. 7,956,779, issued on June 7, was assigned to National Taiwan University...
US Patent Issued to Intel on June 11 for "Method and Apparatus for Efficient Bi-Linear Interpolation and Motion Compensation" (California Inventors)
Jun 12, 2013; ALEXANDRIA, Va., June 12 -- United States Patent no. 8,463,837, issued on June 11, was assigned to Intel Corp. (Santa Clara,...
Wipo Publishes Patent of Lisa K. Wu, Thomas D. Fletcher, Intel, Jesus Corbal and Andrew T. Forsyth for "Instruction and Logic to Provide Vector Linear Interpolation Functionality" (American, Spanish Inventors)
Jun 21, 2013; GENEVA, June 21 -- Publication No. WO/2013/089791 was published on June 20.Title of the invention: "INSTRUCTION AND LOGIC TO...