Adam M. answered • 01/03/20

PhD Mathematician with a Wealth of Teaching Experience

If you are at position **(x**_{0}**,y**_{0}**)** and your target is at position **(x**_{1}**,y**_{1}**)**, then your problem is equivalent to calculating the angle between **v=(x**_{1}**-x**_{0}**, y**_{1}**-y**_{0}**)** and **e_1=(1,0)**. The vector **v** is based at **(0,0)** and points in the direction from your position to the target's. The vector **e_1** points faces** 0°** from **(0,0)**.

Recall that the angle between two vectors **v=(v**_{1}**,v**_{2}**),w=(w**_{1}**,w**_{2}**)** can be calculated via the dot product: **v·w=v**_{1}**w**_{1}**+v**_{2}**w**_{2}**=|v||w|cos(θ)**, where θ is the angle between the two vectors. Thus, we find

** cos(θ)=(v**_{1}**w**_{1}**+v**_{2}**w**_{2}**)/(|v||w|) **

** ⇒ θ = arccos((v**_{1}**w**_{1}**+v**_{2}**w**_{2}**)/(|v||w|))**

Recall also that the length of the vector **v=(v_1,v_2)** is calculated via the pythagorean theorem: **|v|=√(v**_{1}^{2}**+v**_{2}^{2}**). **

For your particular problem, we have **v=(-5,-35) **and **w=(1,0)**. Thus, we get

**θ=arccos(-5/√(5**^{2}**+35**^{2}**))≈98.13°**

This is only the magnitude of the angle. It is not immediate whether this angle is to be traversed in the clockwise or counterclockwise direction. This is determined by what quadrant v lives in. If **v** is in the upper half plane (quadrants 1 and 2), then the angle should be traversed counterclockwise. If **v** is in the lower half plane (quadrants 3 and 4), the angle should be traversed clockwise. So for your particular problem:

**A person facing 0° at position (10,25) must turn 98.13° clockwise to aim at a target positioned at (5,-35).**

Angelo S.

Lovely! Altho I faced hard time finding what each symbol meaning. That's my entirely fault for being so bad with this subject! Really thanks :D01/04/20