[Math] Using linear interpolation between two points to find the three remaining points

interpolation

enter image description here

I am taking a graphics programming course, and I am looking at how Linear interpolation can be used to move points from one location to another location within a certain time.

My mathematics background information is poor, so can someone explain how the formula given for LERP (to animate movement) is used.

When it comes to programming, I can implement this in no time, but what is the point with out understanding the equation and technical information.

$$P(t) = (1-t)P + tQ $$

The above is the formula given. What I am confused about is are variables used. What is $P$ , and $Q$? are these the vector points, and if yes, can they be any letters, or is this a convention in maths?

Why does $t$ have to be between $0$ and $1$?

Best Answer

According to your visual example, yes, $P$ and $Q$ are 2-dimensional vectors. The equation in terms of vectors is just a compact way of writing the equations for the two entries in the vector. $P(t)$ gives the position at time $t$ assuming you start at $P$ at $t = 0$ and end at $Q$ at $t = 1$, and travel with constant velocity. The reason why you should typically assume $0 \leq t \leq 1$ is that this is the range of the data you were given, i.e. you have a start point at $t = 0$ and an end point at $t = 1$.

Related Question