Write a program that calculates trigonometric values The program allows the user
ID: 3673731 • Letter: W
Question
Explanation / Answer
program:
min=input('Enter minimum degree greater than or equal to zero:');
max=input('Enter maximum degree less than 90 :');
if (min>=0) && (max<=89)
disp('Angle(degrees) Angle(radians) sin cos tan');
for x=min:5:max
r = (x*pi)/180;
sy=sin(r);
cy=cos(r);
ty=tan(r);
fprintf(' %.4f %.4f %.4f %.4f %.4f ',x,r,sy,cy,ty);
end
end
output:
Enter minimum degree greater than or equal to zero:24
Enter maximum degree less than 90 :60
Angle(degrees) Angle(radians) sin cos tan
24.0000 0.4189 0.4067 0.9135 0.4452
29.0000 0.5061 0.4848 0.8746 0.5543
34.0000 0.5934 0.5592 0.8290 0.6745
39.0000 0.6807 0.6293 0.7771 0.8098
44.0000 0.7679 0.6947 0.7193 0.9657
49.0000 0.8552 0.7547 0.6561 1.1504
54.0000 0.9425 0.8090 0.5878 1.3764
59.0000 1.0297 0.8572 0.5150 1.6643
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.