# Interpolation online - linear interpolation

Interpolation - it's just finding middleware, unknown value (numbers) Y1 at a known number of X1 within the limits certain boundaries (X0...Xn) && (Y0...Yn), where each X value is associated with the value ofУ.

It is not clear that such interpolation? Let me explain simply an example:

Imagine that you need to run a distance of 10 (km) (10 → 0)! Here you come to the starting line and start to run the race! Immediately from the start you ran at a speed 18 (km/hr). That you run, run and your speed gradually and evenly falls in overcoming distance. You run up to the finish line 0 (km) and cross it at a speed of already 3 (km/hr).

And you began to wonder what was your speed by 5 (km) from the finish? Can all known data presented in the form table below:

kmkm/hr
x0 = 10y0 = 18
x1 = 5 y1 = ?
xn = 0 yn = 3

You understand that the interpolation - is finding value strictly within the specified boundaries ([10(18)...5(?)...0(3)]). If our goal was to find the velocity outside the boundary (10 - 0) Let's say for example we would have ran on without stopping after the finish and ran to another 2 km (ie a total of 12 12), then to find the velocity outside the boundary ([10(18)...0(3)]...-2(?)) we need a linear extrapolation rather than interpolation!

PS: I could not explain it standardized template definition ascribed to and imposed on all educational institutions, but first and foremost I write for people, accessible human language, and then for the people's machines!