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
2009-10-06 10:24:29
That is what I was looking for..... Thanks. I do not need reflex angle.
OliveOne
2009-10-06 10:32:25
Glad I could help.
Crimson
2009-10-06 10:33:31
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
2009-10-06 11:51:27
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
2009-10-06 12:20:50