Calculating sin and cos functions
이전 댓글 표시
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??
채택된 답변
추가 답변 (1개)
bym
2011년 5월 29일
sin() & cos() arguments are in radians. If you want degrees use
sind() cosd()
댓글 수: 3
Mohsin Shah
2011년 5월 29일
Muhammed Çelik
2020년 4월 20일
or, you can do like this sin(degree*pi/180)
Steven Lord
2020년 4월 20일
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.
카테고리
도움말 센터 및 File Exchange에서 Lengths and Angles에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!