Now we want to estimate what value we would get for some value that is
between and . Call this value estimate — an interpolated
value.
Two simple methods for choosing come to mind. The first is see whether
is closer to or to . If is closer to then we use
as the estimate, otherwise we use . This is called nearest
neighbor interpolation.
The second is to draw a straight line between and . We
look to see the value on the line for our chosen . This is linear
interpolation.
It is possible to show that the formula of
the line between and is: