Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1 A triangle is defined by the x and y coordinates of its three corner points. Write a Python program to input these coordinates
Problem 1 A triangle is defined by the x and y coordinates of its three corner points. Write a Python program to input these coordinates and compute and display) the following properties: b a B Figure 1: Triangle Sample The lengths of the 3 sides 2 The perimeter The area The angles at all 3 corners (in both radians and degrees) Write a function for each of the properties that needs to be computed. For each function, write a brief one-line description of what the function does, followed by the list of the parameters and what they are for, and a description of what the function returns. A sample run of your program might look something like this: 2 The perimeter The area The angles at all 3 corners (in both radians and degrees) Write a function for each of the properties that needs to be computed. For each function, write a brief one-line description of what the function does, followed by the list of the parameters and what they are for, and a description of what the function returns. A sample run of your program might look something like this: Enter x coordinate for A: 4 Enter y coordinate for A: 4 Enter x coordinate for B: 23 Enter y coordinate for B: 4 Enter x coordinate for C: 20 Enter y coordinate for C: 17 Length of the side a: 13.34 Length of the side b: 20.62 Length of the side c: 19.0 Perimeter: 52.96 Area: 123.5 Angle A: 0.68 radians (38.96 degrees) Angle B: 1.34 radians (76.78 degrees) Angle C: 1.12 radians (64.17 degrees) Figure 2: Program Example Hints: Reference site: SSS Theorem Use "Heron's formula" to compute the area. Use the Law of Cosines to compute the angles. The inverse cosine (also called arc cosine) can be computed using math.acos(x), where x is a double representing the angle expressed in radians. This method returns a double; also in radians. Recall that 21 x radians = 360 degrees. In Python, a is available as a constant math.pi from the Math class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started