Different approaches to calculating angle between two vectors

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?

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