Re:Why is e^(pi i) = -1?
by alan-crowe on Friday October 30, 2009 @08:06PM
(#913056)
You remember those half-angle formulae
sin 2A = 2 sin A cos A
cos 2A = (cos A)^2 - (sin A)^2
If you are happy using sine of small x is x and cosine of small x is 1 as your base cases, you can write sine and cosine as mutually recursive functions:
(sin pi) => 6.167817939221069d-7 quite close to zero
(cos pi) => -1.0012055113842453d0 you can get this
much closer to -1 by using 1-x^2/2 as your base case.
It had never occurred to me to do exponential the same way, as
sin 2A = 2 sin A cos A
cos 2A = (cos A)^2 - (sin A)^2
If you are happy using sine of small x is x and cosine of small x is 1 as your base cases, you can write sine and cosine as mutually recursive functions:
(sin pi) => 6.167817939221069d-7 quite close to zero (cos pi) => -1.0012055113842453d0 you can get this much closer to -1 by using 1-x^2/2 as your base case.It had never occurred to me to do exponential the same way, as
So it is a bit of a shock to try it and see it work just fine for complex numbers(exp (complex 0 pi)) => #C(-1.0012055113842453d0 6.167817939221069d-7)