[R] Euler identity with complex exp

R. Michael Weylandt michael.weylandt at gmail.com
Mon Jan 30 19:40:26 CET 2012


Seems fine to me:

exp(pi + i*2pi) = exp(pi) * exp(i *2pi) = exp(pi) * (cos(2pi) +
i*sin(2*pi)) = exp(pi) *(1+ 0i) = exp(pi) ~ 23.14
exp(pi/2) ~ 4.81

What would you expect?

Michael

On Mon, Jan 30, 2012 at 10:37 AM, Joseph Park <josephpark at ieee.org> wrote:
> Hi,
>
> Am i doing something silly here in expecting Euler's
> formula to be handled by exp? exp( ix ) = cos x + i sin x.
> The first example below follows this, the others not.
>
> Thanks for the education!
>
>  > exp( complex(real = 0, imag = 2*pi) )
> [1] 1-0i
>  > exp( complex(real = pi, imag = 2*pi) )
> [1] 23.14069-0i
>  > exp( complex(real = pi/2, imag = 0) )
> [1] 4.810477+0i
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list