SOLVE IN MATLAB
Given a right triangle ABC, calculate the angle of Theta (degrees) located between AC and AB given values a and b.
Note: https://en.wikipedia.org/wiki/Right_triangle#/media/File:Rtriangle.svg
Filename: Right_Triangle_01.m
Input: a, b
Output: Theta (degrees)
Code in Matlab:
function CalculateAngle(a,b)
p = atand(a/b);
fprintf('the angle of Theta (degrees) located
between AC and AB is %d \n',p);
end
CalculateAngle(1,0);
CalculateAngle(1,1);
CalculateAngle(0,1);
CalculateAngle(-1,1);
=======================================================================
Adding Image amnd Output.
Output
Let me know if there is any concern.
Get Answers For Free
Most questions answered within 1 hours.