Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

Students also viewed these Databases questions