0

I'm implementing lerp function with time parameter and got stucked at how to involve time(t) in the formular. I have the original coordinates of vP(xP,yP) and the destination coordinates of vM(xM,yM). And it was asked to go through the distance at exactly three seconds.

I know from the lerp equation I can get any points between vP and vM. But how can I achieve the goal of three seconds? Thanks!

  • Hint: find the velocity vector $\vec v$ between two points and express the position of a point at time $t$ as the sum of $vP(xP,yP)$ and the product of $\vec v t$. – Frenzy Li Aug 14 '16 at 08:43

1 Answers1

1

In vector notation, the position $\vec x$ is given by: $$ \vec x= \begin{bmatrix} x\\y \end{bmatrix} = \begin{bmatrix} x_P\\y_P \end{bmatrix} +\frac{t}{3} \begin{bmatrix} x_M-x_P\\y_M-y_P \end{bmatrix} $$

Emilio Novati
  • 62,675