(atan2): For x <= 0, lump y == 0 with y > 0
to get the right result in 0, -1 case. From-SVN: r4645
This commit is contained in:
parent
e1027c772e
commit
2b3989120d
|
@ -155,19 +155,19 @@ atan2 (double y, double x)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (y > 0)
|
||||
{
|
||||
if (-x > y)
|
||||
return pi + atan (y / x);
|
||||
else
|
||||
return pi_over_2 - atan (x / y);
|
||||
}
|
||||
else
|
||||
if (y < 0)
|
||||
{
|
||||
if (-x > -y)
|
||||
return - pi + atan (y / x);
|
||||
else if (y < 0)
|
||||
else
|
||||
return - pi_over_2 - atan (x / y);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-x > y)
|
||||
return pi + atan (y / x);
|
||||
else if (y > 0)
|
||||
return pi_over_2 - atan (x / y);
|
||||
else
|
||||
{
|
||||
double value;
|
||||
|
|
Loading…
Reference in New Issue