why trigonometry input in degrees gives wrong results
Show older comments
Hello, Here is a simple trigonometry functions where i have given data in degrees and radians, why i am getting a wrong result when i am giving in degrees.
>> a=30 a =
30
>> b=pi/6
b =
0.5236
>> c=sin(a)
c =
-0.9880
>> d=sin(b)
d =
0.5000
Accepted Answer
More Answers (1)
Image Analyst
on 12 Jul 2014
Use the "d" versions of the trig functions when you want to input in degrees:
sind(30) % Uses sind() rather than sin().
sin(pi/6)
ans = 0.5
ans = 0.5
Categories
Find more on Physical and Time Unit Conversions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!