what is the difference between cos(8) and cosd(8)

34 ビュー (過去 30 日間)
Stark Volt
Stark Volt 2022 年 2 月 22 日
コメント済み: necdet batuhan 2024 年 2 月 21 日
I write an equation related to using cosine, sine, tangent but everytime I run mathlab show me a negative result but when I use calculator it is a positive and giving me correct number. so after a little bit digging and I find that it has something to do with cos, sin, tan, cosd, sind, tand what the difference having d or withouth d?
cos(8)
cosd(8)
sin(20)
sind(20)
tan(30)
tand(30)

採用された回答

Voss
Voss 2022 年 2 月 22 日
編集済み: Voss 2022 年 2 月 22 日
With the d, the input angle is interpreted as being in degrees. Without the d, it's in radians.
Example, these two commands will produce the same output:
cos(pi/4) % pi/4 radians = 45 degrees
ans = 0.7071
cosd(45)
ans = 0.7071
  2 件のコメント
Stark Volt
Stark Volt 2022 年 2 月 22 日
Thank you, that's help
necdet batuhan
necdet batuhan 2024 年 2 月 21 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by