Different approaches to calculating angle between two vectors

46 Views Asked by At

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?