I guess the algorithm could first test if orientation is negative
Code: Select all
(ax-cx)*(by-cy)-(bx-cx)*(ay-cy) > 0
Code: Select all
phi = arccos(A.dot(B) / (A.length() * B.length())
Code: Select all
(ax-cx)*(by-cy)-(bx-cx)*(ay-cy) > 0
Code: Select all
phi = arccos(A.dot(B) / (A.length() * B.length())
Code: Select all
vector3df B,E,F,result1,result2;
f32 PHI1,PHI2,PHI;
result1 =E-B;
result1 = result1.getHorizontalAngle();
PHI1=result1.Y;
result2 =F-B;
result2 = result2.getHorizontalAngle();
PHI2=result2.Y;
PHI=PHI1-PHI2;
if (PHI>180)
{
PHI=-(360-PHI)
};