I have 2 coordinates, the source, and the destination. I can calculate the distance between the two points, but I have to know at which coordinates something that’s walking from source to destination is, after some time has passed, given a specific walk speed (units/ms). What would be the best way to do this?
This is most likely a simple problem, but it’s hard to search for it, seeing how I don’t know the exact mathematical terms.
Given a point A (source) with coordinates (Xa, Ya) and a point B (Xb,Yb) the destination, the distance betwwen them is
Da,b = Sqrt((Xa-Xb)^2 + (Ya-Yb)^2)
*Sqrt = square root
After t seconds the moving object,(it moves at U speed) will be at the point T (Xt, Yt).
The distance from the source is
Da,t = U*t
The coordinates of point T are
Xt = Xa + (Xb – Xa)*Dat/Dab
Yt = Ya + (Yb – Ya)*Dat/Dab