View Full Version : Re: Calculation of 2D Angles

Allan Carman
01-07-2003, 08:25 PM
Dear Chris,

Thank you for your reply.
The unit vector is required, I will endeavour to expand on the
method presented and to add some thoughts on the topic.

With a 2D vector a given by (x,y) and the axes by i(1,0) and
j(0,1). The angle between a and the positive i axis is given by:
cos(theta1) = a.i/||a||.||i|| = x/||a||
Similarly, The angle between a and the positive j axis is given by:
sin(theta2) = a.j/||a||.||i|| = y/||a||

with ||a|| the length of a, therefore
theta1 = acos(x/||a||)
theta2 = asin(y/||a||)

With 0