How can I get the "zero" value of cosine function in radians??
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yasir
am 11 Mär. 2016
Beantwortet: Steven Lord
am 11 Mär. 2016
Due to the approximations and radian values used by MATLAB, I can't get "zero" value of cosine function. "acos(0)" gives answer of 1.5708 radians, but Cos(1.5708) doesn't lead to "zero". Can anyone help??
2 Kommentare
Roger Stafford
am 11 Mär. 2016
Please show us your actual computations. You are only showing values in 'format short' here which is not very accurate. Expressed to greater accuracy the arc-cosine of zero would for example be 1.570796327
Akzeptierte Antwort
Steven Lord
am 11 Mär. 2016
Use the degree-based trig functions or Symbolic Math Toolbox.
d = acosd(0);
cosd(d)
ds = acos(sym(0));
cos(ds)
There's a brief discussion of this sort of scenario [where cos(pi/2) is close to, but not exactly equal to, 0] in the Cleve's Corner article from February 2002 that you might find informative.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!