Skip to content

Commit

Permalink
Fixed acute angle calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rynbrd committed Jan 8, 2012
1 parent 62c395e commit 63bda3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/trig.c
Expand Up @@ -62,10 +62,14 @@ double trig_angles_sub(double a1, double a2)

double trig_angles_acute(double a1, double a2)
{
double angle;
if (a1 > a2)
return trig_angles_sub(a1, a2);
angle = trig_angles_sub(a1, a2);
else
return trig_angles_sub(a2, a1);
angle = trig_angles_sub(a2, a1);
if (angle > 4)
angle = 8 - angle;
return angle;
}

int trig_angles_cmp(double a1, double a2)
Expand Down

0 comments on commit 63bda3a

Please sign in to comment.