lerp with time parameter?

122 Views Asked by At

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!

1

There are 1 best solutions below

0
On

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} $$