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.

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to