[Scilab-users] About the complex inverse tangent function

Samuel Gougeon sgougeon at free.fr
Thu Aug 14 19:55:27 CEST 2014


Le 14/08/2014 19:46, Samuel Gougeon a écrit :
> -->disp([atan(z),%i/2*log((%i+z)/(%i-z))])
>
>     1.5707963 + 0.5493061i    1.5707963 + 0.5493061i
>
> This is a strange result for the log expression, since we could expect 
> -1.57.. rather than 1.57...
> Indeed, with z = 2.i, we have: (i+z)/(i-z) = 3i/ -i = -3 = 3.i^2 => 
> ln(3.i^2) = ln(3) + 2 ln(i)
> with i = exp(i.pi/2), so : .. = ln(3) + 2.i.pi/2 = ln(3) + i.pi
> Hence: i/2 * ln((i+z)/(i-z)) = i.ln(3)/2 - pi/2 : the real part is < 0.
> If there is an issue, it could be with  log() rather than with atan().
Actually, we have -3 = 3.exp(i.pi) but also = 3.exp(-i.pi), leading to 
ln(3) - i.pi .. and so i.ln(3)/2 + pi/2 :
The real part is here modulo pi (due to the i/2 factor) ; so the Scilab 
output is correct for the log.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140814/2643a589/attachment.htm>


More information about the users mailing list