>>>>> Christian Heimes <[email protected]> (CH) wrote:

>CH> You can write your own phase() function. This function is mostly correct
>CH> unless either the real and/or the imag part is NaN or INF.

>CH> from math import atan2

>CH> def phase(z):
>CH>     z += 1j # convert int, long, float to complex

That should be z += 0j

>CH>     return atan2(z.imag, z.real)

-- 
Piet van Oostrum <[email protected]>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: [email protected]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to