Linear Interpolation Calculator

This calculator uses the linear interpolation formula: Y = Y1 + (X - X1) * (Y2 - Y1) / (X2 - X1)


Add this Calculator to Your Site

What is Linear Interpolation?

Linear interpolation is a mathematical method used to estimate an unknown value that falls between two known data points. It assumes that the change between the two points is linear (follows a straight line), making it one of the simplest and most commonly used interpolation techniques.

The Linear Interpolation Formula

The formula for linear interpolation is:

Y = Y1 + (X - X1) * (Y2 - Y1) / (X2 - X1)

Where:

  • (X1, Y1) - The first known data point
  • (X2, Y2) - The second known data point
  • X - The X value for which you want to find Y
  • Y - The interpolated result

Alternative Forms of the Formula

The linear interpolation formula can also be written as:

Y = Y1 + ((Y2 - Y1) / (X2 - X1)) * (X - X1)

Or using the slope-intercept form:

Y = Y1 + m * (X - X1)
where m = (Y2 - Y1) / (X2 - X1)

How to Use This Calculator

  1. Enter the first known point (X1, Y1)
  2. Enter the second known point (X2, Y2)
  3. Enter the X value for which you want to find Y
  4. Click "Calculate" to get the interpolated Y value

Example Calculations

Example 1: Temperature Interpolation

You know the temperature is 20C at 8:00 AM (X1=8, Y1=20) and 30C at 12:00 PM (X2=12, Y2=30). What's the temperature at 10:00 AM (X=10)?

Y = 20 + (10 - 8) * (30 - 20) / (12 - 8)
Y = 20 + 2 * 10 / 4
Y = 20 + 5
Y = 25C

Example 2: Price Estimation

A product costs $100 when quantity is 10 (X1=10, Y1=100) and $80 when quantity is 50 (X2=50, Y2=80). What's the price at quantity 30?

Y = 100 + (30 - 10) * (80 - 100) / (50 - 10)
Y = 100 + 20 * (-20) / 40
Y = 100 - 10
Y = $90

Applications of Linear Interpolation

Engineering

Engineers use linear interpolation to estimate values from lookup tables, such as material properties at specific temperatures or pressures not directly listed in reference tables.

Computer Graphics

In computer graphics, linear interpolation (often called "lerp") is used for smooth animations, color gradients, and texture mapping.

Data Analysis

Analysts use interpolation to fill in missing data points in datasets or to estimate values between measured observations.

Finance

Financial analysts use linear interpolation to estimate bond yields, interest rates, and other financial metrics between known data points.

Limitations

Linear interpolation assumes a constant rate of change between points. For data that follows curves or non-linear patterns, more advanced methods like polynomial or spline interpolation may be more accurate.

Other Calculators