DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Nov 1: register now to lock in today's rate
Register Now →

complex exponential - what Am I missing?

Started by Sharan123 9 years ago●6 replies●latest reply 9 years ago●281 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 Lyons●June 15, 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 Sharan123●June 15, 2017

Apologies. That was really stupid of me

[ - ]
Reply by Rick Lyons●June 15, 2017

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

[ - ]
Reply by Cedron●June 15, 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 Sharan123●June 15, 2017

Cedron,

Thanks. I will take a look.

[ - ]
Reply by UliBru●June 15, 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