## Linear Interpolation

Post any maths and/or physics related questions here.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

### Linear Interpolation

I was hoping someone could help me understand why it is the following formula for linear interpolation works, I mean I have tried it and it works, but I'd like to really understand what is going on in it..

You have your two coords, (x1, y1) and (x2, y2)

x and y are points inbetween (x1, y1) and (x2, y2)

y = y1 + (y2 - y1) / (x2 - x1) * (x - x1)

So what is actually occuring here? I'm really confused.
Guest

y = y1 + (y2 - y1) / (x2 - x1) * (x - x1)

rearranged gives:

y - y1 = m(x - x1)

You must have seen this before? It is derived from y = mx + c ...
If it wasn't for C, we would be using BASI, PASAL and OBOL.

tomcant

Posts: 3101
Joined: Tue Sep 23, 2003 1:56 am
Location: Colchester, UK

ah thanks, I must have had a brainfart. Couldn't quite relate the formula to y = mx + c, or jsut wasn't thinking straight.
Guest