0

I am struggling to find a formula to calculate if a moving object goes towards a certain direction. I have $P_1$, which is the current position $(x_1, y_1)$, and its direction angle. I also have the position of a target $(x_2, y_2)$. How can I calculate if the currently moving object goes toward the target position?

jvdhooft
  • 7,589
  • 9
  • 25
  • 47
Aody
  • 1

1 Answers1

0

More information is necessary to answer this question. If object is moving in a vacuum with no external forces pressing on it, then it will simply keep moving in a straight line in the direction given by the direction angle (which I will call $\theta$).

It will hit the target if the vector (x2,y2)-(x1,y1) is proportional (by a positive constant!) to the vector $(\cos(\theta),\sin(\theta)).$

If the object is subject to gravity, drag, etc... then the problem becomes more complicated and we need more information (if nothing else we would need the initial velocity of the object). One could solve the problem:

Given initial object (x1,y1) subject only to gravity, target position (x2,y2), the mass of the moving object and the direction angle, how much force is necessary to hit (x2,y2) although this places constraints on the possible initial angle (e.g. we could not shoot the object downward or backward and have it hit the target).

marlow
  • 100
  • Thanks for answering. The moving object is a car. How can I know if vector (x2,y2)-(x1,y1) is proportional to the vector (cos(θ),sin(θ)). – Aody Jan 31 '19 at 16:45
  • Calculate both vectors (find actual numbers and plot them in standard position). If you don't see it at that point, I would recommend consulting your textbook for an example! The whole point of this problem as stated is to check if you understand what all of these vector operations (addition, subtraction, angles, etc...) mean.

    See: https://en.wikipedia.org/wiki/Euclidean_vector#Addition_and_subtraction and look at the pictures

    – marlow Jan 31 '19 at 17:20