2
$\begingroup$

I can calculate angle θ between two dimensional vectors a and b as the inverse cosine of their dot product divided by their magnitude:

θ = arccos (a · b / (|a| * |b|)), where |a|≠0 and |b|≠0   (1)

I have also seen it calculated like this:

θ = arctan(a.y / a.x) - arctan(b.y / b.x), where a.x≠0 and b.x≠0  (2)

What is the difference between these two approaches and can I derive the first formula from the second or vice versa?

$\endgroup$
  • $\begingroup$ @Aqua coordinates of vector a and b $\endgroup$ – Lenny White Aug 17 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.