Forums

complex exponential - what Am I missing?

Started by Sharan123 3 years ago6 replieslatest reply 3 years ago118 views

The following is from Wikipedia - https://en.wikipedia.org/wiki/Euler%27s_formula

capture_43658.jpg

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?

[ - ]
Reply by Rick LyonsJune 14, 2017

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)




[ - ]
Reply by Sharan123June 14, 2017

Apologies. That was really stupid of me

[ - ]
Reply by Rick LyonsJune 14, 2017

Sharan123, don't worry.  The only people who never makes mistakes are people who never do anything.  :-)

[ - ]
Reply by CedronJune 14, 2017

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

Ced

[ - ]
Reply by Sharan123June 15, 2017

Cedron,

Thanks. I will take a look.

[ - ]
Reply by UliBruJune 14, 2017

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