Skip to content

Commit

Permalink
modify simplemath.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
HonestDeng committed Sep 6, 2023
1 parent a6878d5 commit a3c13a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/simplemath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,19 +429,20 @@ float atan2f(float y, float x)
{
return copysignf(PI_2, y);
}

if (x > 0 && y > 0)
{
return atanf(y / x);
}
if (x < 0 && y > 0)
else if (x < 0 && y > 0)
{
return PI - atanf(y / -x);
}
if (x > 0 && y < 0)
else if (x > 0 && y < 0)
{
return -atanf(-y / x);
}
if (x < 0 && y < 0)
else
{
return -PI + atanf(-y / -x);
}
Expand Down

0 comments on commit a3c13a9

Please sign in to comment.