Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

What are the risks associated with the taxation of an FLP?

Answered: 1 week ago

Question

9. System creates a large, diverse talent pool.

Answered: 1 week ago