Linear Interpolation Calculator

Find a value between two known data points using the linear interpolation (LERP) formula.

Enter Known Points & Target

Result

Interpolated Value (y)
--
Point 1 --
Point 2 --
Target x --
Slope (rise/run) --

Step-by-Step Solution

y = y1 + (x - x1)(y2 - y1) / (x2 - x1)

What Is Linear Interpolation?

Linear interpolation (often abbreviated as LERP) is a method of estimating an unknown value that falls between two known data points. It assumes a straight-line relationship between the points, making it one of the simplest and most widely used interpolation techniques in mathematics, engineering, and computer science.

Given two points (x1, y1) and (x2, y2), linear interpolation finds the value y for a given x that lies on the straight line connecting these two points.

The Linear Interpolation Formula

The standard formula for linear interpolation is:

Standard Form

The most common representation of the LERP formula.

y = y1 + (x - x1)(y2 - y1) / (x2 - x1)

Parametric Form

Using parameter t where t = (x - x1) / (x2 - x1).

y = (1 - t) * y1 + t * y2

Slope-Based Form

Using the slope m = (y2 - y1) / (x2 - x1).

y = y1 + m * (x - x1)

How Linear Interpolation Works

The process involves three conceptual steps:

  1. Calculate the slope: Find the rate of change between the two known points, m = (y2 - y1) / (x2 - x1).
  2. Determine the offset: Calculate how far the target x is from x1, which gives you (x - x1).
  3. Compute the result: Multiply the slope by the offset and add it to y1 to get the interpolated value.

Applications of Linear Interpolation

  • Data analysis: Estimating missing values in datasets.
  • Computer graphics: Smooth color transitions, texture mapping, and animation blending.
  • Engineering: Estimating values from lookup tables and sensor readings.
  • Finance: Estimating interest rates or prices between known data points.
  • Science: Temperature, pressure, and concentration estimates between measured points.

Limitations

Linear interpolation assumes a constant rate of change between the two points. For data with curvature, polynomial interpolation, spline interpolation, or other methods may provide more accurate estimates. Additionally, extrapolating beyond the known data range can produce unreliable results.