Interpolation
Linear Interpolation
Given two points (x0,y0) and (x1,y1), estimate the value y at a query point x by linear interpolation: slope=(y1-y0)/(x1-x0), then y=y0+slope*(x-x0). Example: (1,2),(3,8) with x=2 gives slope=3 and y=5.
The slope of the line through (x0,y0) and (x1,y1) is: slope = (y1 - y0) / (x1 - x0) The interpolated value at query point x is: y = y0 + slope * (x - x0)
Example
linear-interpolation
Linear interpolation fits a straight line through two known points and evaluates it at any intermediate x.