[Numpy-discussion] arctan2 with complex args
David Goldsmith
David.L.Goldsmith@noaa....
Mon Apr 30 10:33:41 CDT 2007
Timothy Hochberg wrote:
>
>
> On 4/30/07, *David Goldsmith* <David.L.Goldsmith@noaa.gov
> <mailto: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).
Was it: "pi/2 is outside the range of arctan"? (No worries: I thought of
this too when I saw what value fell out of the formula, but then, it's
outside the range of the *real-valued* function, but clearly it's not
outside the range of the *complex-valued* function.)
DG
> 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.
>
>
> DG
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org <mailto:Numpy-discussion@scipy.org>
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>
> --
>
> //=][=\\
>
> tim.hochberg@ieee.org <mailto:tim.hochberg@ieee.org>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
More information about the Numpy-discussion
mailing list