Problem calling math.cos()

Tim Peters tim.peters at gmail.com
Sat Apr 22 16:15:26 EDT 2006


[Robert Kern]
> ...
>     ph3 = math.atan( ac3.imag / ac3.real )
> ...

Don't do that:  atan2 is the correct way to compute the angle, because
the signs of both inputs are needed to determine the correct quadrant.
 So do:

     ph3 = math.atan2(ac3.imag, ac3.real)

instead.



More information about the Python-list mailing list