In article <[EMAIL PROTECTED]>, "Tim Peters" <[EMAIL PROTECTED]> wrote:
> [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. I certainly agree about using atan2() instead of atan(), but I'm surprised there's not an easier way to get the phase of a complex, just like abs() gives you the modulus. I can see why you wouldn't want to pollute the global namespace with another built-in just for this purpose, but surely a complex.phase property wouldn't hurt? -- http://mail.python.org/mailman/listinfo/python-list