
Adam M. answered 01/03/20
PhD Mathematician with a Wealth of Teaching Experience
If you are at position (x0,y0) and your target is at position (x1,y1), then your problem is equivalent to calculating the angle between v=(x1-x0, y1-y0) 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=(v1,v2),w=(w1,w2) can be calculated via the dot product: v·w=v1w1+v2w2=|v||w|cos(θ), where θ is the angle between the two vectors. Thus, we find
cos(θ)=(v1w1+v2w2)/(|v||w|)
⇒ θ = arccos((v1w1+v2w2)/(|v||w|))
Recall also that the length of the vector v=(v_1,v_2) is calculated via the pythagorean theorem: |v|=√(v12+v22).
For your particular problem, we have v=(-5,-35) and w=(1,0). Thus, we get
θ=arccos(-5/√(52+352))≈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