Complex numbers, abs results in mag, what results in phase?

noyb soufle at yahoo.com
Thu Nov 7 17:41:34 EST 2002


I am trying to find out how to get the phase or angle of a complex
number in Python 2.2.  Yes, I have Numpy installed.

I have found how to get the magnitude of a complex number, use "abs".

I have also found how to get the real and imaginary parts but am
stumped by the angle.

I am using something like:

my_complex_variable = (a +bj)

and I can do

abs(my_complex_variable) 

to get the magnitude.

I realize the angle is atan(b,a) but I need to use my_complex_variable
as input and not a,b.

Hope someone knows of a comand I am missing.

David



More information about the Python-list mailing list