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

noyb soufle at yahoo.com
Fri Nov 8 07:24:54 EST 2002


In article <y9Cy9.3877$Bs5.116582 at news1.tin.it>, Alex Martelli
<aleax at aleax.it> wrote:

> noyb wrote:
> 
> > I realize the angle is atan(b,a) but I need to use my_complex_variable
> > as input and not a,b.
> 
> import math
> def phase(mcv):
>     return math.atan2(mcv.imag, mcv.real)
> 
> I don't think there's any Python built-in that does this.
> 
> 
> Alex
> 

Hi Alex,

Thank you!

Since I am a neophyte to Python, I was spending to much time looking
for a command.  This seems obvious now!

Thanx again,

David



More information about the Python-list mailing list