# Linear Interpolation Calculator

Linear interpolant is the straight line between the two known coordinate points. If the two known values are (x1, y1) and (x2, y2), then the y value for some point x is: y = y1 + (x - x1) x [(y2-y1)/(x2-x1)]. Linear interpolation on a set of data points (x0, y0), (x1, y1), ..., (xn, yn) is defined as the concatenation of linear interpolants between each pair of data points. Using Linear Interpolation Calculator, calculate the linear interpolation value from the known coordinate points.

## Linear Interpolation Value Calculation

Code to add this calci to your website

#### Formula Used

Y = ( ( X - X1 )( Y2 - Y1) / ( X2 - X1) ) + Y1
**Where,**
X1,Y1 = First co-ordinates,
X2,Y2 = Second co-ordinates,
X = Target X co-ordinate,
Y = Interpolated Y co-ordinate.

#### Example

**Linear interpolant of a straight line has target as 9 ,X**_{1} as 5, Y_{1} as 6, X_{2} as 8 and Y_{2} as 9, find its interpolated value Y.

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

= ((9 - 5)*(9 - 6) / (8 - 5)) + 6

= (4*3/3)) + 6

= 4 + 6

= 10