tags:

views:

506

answers:

1

How to calculate obtuse angle between two vectors if both vectors and x axis is given. First vector can be taken as x axis. we can get acute by dot product and acos.

+2  A: 

Before applying acos, check if the dot product is negative. If negative, the angle is obtuse :)

Further, as acos has a range of 0 to pi, you will do fine as long as you do not want reflex angles (>pi)

Crimson
That is what I was looking for..... Thanks. I do not need reflex angle.
OliveOne
Glad I could help.
Crimson
Sorry, But I could not able to get full angles... I have list of points and two external point (one is origin and second is on x). I should get 0,45,90,135,180,225,270,315,360 in case of 9 points on circle
OliveOne
Assuming your known points are origin O (0,0), vector1 head A (x,0) - on the x-axis and another point B (m,n). If you want the angle made by OA and OB, the angle would be acos(m/sqrt(m*m + n*n))*180/pi degrees.
Crimson