Calculating sin and cos functions
Afficher commentaires plus anciens
Hello, i calculated the value of sin(45) in Matlab, the result was sin(45)=0.8509 and for cosin i got cos(45)= 0.5253. From general mathematics we know that sin(45)=cos(45) then why Matlab is giving different results??
Réponse acceptée
Plus de réponses (1)
bym
le 29 Mai 2011
sin() & cos() arguments are in radians. If you want degrees use
sind() cosd()
3 commentaires
Mohsin Shah
le 29 Mai 2011
Muhammed Çelik
le 20 Avr 2020
or, you can do like this sin(degree*pi/180)
Steven Lord
le 20 Avr 2020
If you're going to convert degrees to radians or vice versa, use the deg2rad or rad2deg functions moved from Mapping Toolbox to MATLAB in release R2015b rather than the "magic number" of pi/180.
Catégories
En savoir plus sur Lengths and Angles dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!