complex exponential - what Am I missing?
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
The following is from Wikipedia - https://en.wikipedia.org/wiki/Euler%27s_formula
below is what I get when I try for 0 and 30 deg
>> sqrt(cos(0)+sin(0))
ans = 1
>> sqrt(cos(30*2*pi/360)+sin(30*2*pi/360))
ans = 1.1688
Should I not be expecting ans = 1 for every value of theta?
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/14446.jpg)
Hi. To reinforce what UliBru wrote, your
sqrt(cos(30*2*pi/360)+sin(30*2*pi/360))
command should be changed to:
sqrt(cos(30*2*pi/360)^2 + sin(30*2*pi/360)^2)
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Apologies. That was really stupid of me
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/14446.jpg)
Sharan123, don't worry. The only people who never makes mistakes are people who never do anything. :-)
![](https://d23s79tivgl8me.cloudfront.net/user/profilepictures/103185.jpg)
If your goal is to understand Euler's equation, you might find my first blog article helpful:
"The Exponential Nature of the Complex Unit Circle"
https://www.dsprelated.com/showarticle/754.php
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
Cedron,
Thanks. I will take a look.
![](https://www.embeddedrelated.com/new/images/defaultavatar.jpg)
The basic formula is
sqr(sin(alpha)) + sqr(cos(alpha)) = 1
Thus the correct formula for your example is
sqrt(sqr(sin(alpha)) + sqr(cos(alpha))) = 1