[Numpy-discussion] arctan2 with complex args

Timothy Hochberg tim.hochberg@ieee....
Mon Apr 30 09:49:57 CDT 2007

On 4/30/07, David Goldsmith <David.L.Goldsmith@noaa.gov> wrote:
> > (hint what is arctan(0+1j)?)
> >
> Well, at the risk of embarrassing myself, using arctan(x+iy) = I get:
> arctan(0+1i) = -i*log((0+i*1)/sqrt(0^2 + 1^2)) = -i*log(i/1) = -i*log(i)
> = -i*log(exp(i*pi/2)) = -i*i*pi/2 = pi/2...
> Is there some reason I'm forgetting (e.g., a branch cut convention or
> something) why this is wrong?

Oops. It may well be OK, I answered too fast (I'd explain my thinking, but
ti would be embarassing). However, I believe atan works in general for
complex numbers but it may well have a problem for this specific case.

I should look at this more closely though since the behaviour near zero does
seem a little odd. No time right now, but maybe later today.

> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070430/62ec5bc6/attachment-0001.html 

More information about the Numpy-discussion mailing list