Question: C programming language 2 Write a program to calculate the radius of a circle inscribed in a triangle, given lengths of two sides a and

C programming language
2 Write a program to calculate the radius of a circle inscribed in a triangle, given lengths of two sides a and b of the triangle and the angle gamma between them. Begin your program with a short comment section. Use a defined constant or constant double to give PI a value of 3.14159265. Use data type double for all variables. Prompt the user for values of a, b, and gamma in degrees a. Calculate the side c of the triangle by substituting the values of a, b, and gamma into the Law of Cosines equation which has been solved for c. Remember that the cosine function requires an argument in radians. Law of Cosines: c = a2 + b2 - 2ab cos(y). b. Calculate the radius r of the circle inscribed in the triangle using the formula r = {(a+b-c) tanc=) c. Calculate the radius r of the circle by a second method using the formula s(s-a)(s -b)(s-c) 1 w (a + = S Print the values for side c and the radius r from each method, using 3 decimal digits. Be sure to include units (mm) in your answers. If a= 200 mm, b = 250 mm, and y = 83 degrees, the radius of the inscribed circle is 66.124 mm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
