I'm having some difficulty trying to comprehend the answers that Matlab and my calculator are returning from sinusoidal functions.
Firstly, I figured that pi/2
and 90 deg
are analogous, but when I pass them into a cosine function I get these two outputs:
cos(90) = 0
cos(pi/2) = 0.9996242169
cos(90) = -0.4481
cos(pi/2) = 6.1232e-17
I have been referencing the unit circle and things don't seem to stack up. I am fairly new to maths, so maybe I may be doing something wrong. I've been practising with the sine function and this is a lot closer to my calculator results:
sin(90) = 0.8940
sin(pi/2) = 1
If you want to provide angle in degrees then use cosd and sind and if angle is in radians then use cos and sin.
cos(0) and cosd(0) are producing 1 on my computer. However cos(pi/2) is producing 6.1232e-17 and cosd(90) is producing 0.
you can check matlab specification which number is close to 0.