Question: USE PYTHON Problem 1 Given three points of a triangle, you can compute the angles using the following formula: x2.72 A - acos((a.a-b be.c) /
Problem 1 Given three points of a triangle, you can compute the angles using the following formula: x2.72 A - acos((a.a-b be.c) / -2.b.)) B - acosib b-a.ac.c) / (-2. a. c) c - acosec-bb-a.a) / (-2.4.b)) B x3,73 xl. y 4 1 import math 2 3 x1, yi, x2, y2, x3, y3 = eval(input("Enter three points: ")) 5a = math.sqrt((x2 - x3)(x2 - x3) + (y2 - y3). (y2 - y3)) 6 b = math.sqrt((x1 X3). (x1 X3) + (y1 - y3) (y1 - y3)) 7 C = math.sqrt((x1 x2)(x1 x2) + (y1 - y2). (y1 - y2)) 8 9 A = math.degrees (math.acos((a . a - bbcc) / (-2.b. c))) 10 B = math.degrees (math.acos((b + b - a * a -CO) / (-2* a * ))) 11 C = math.degrees (math.acos(( cc-bb-a. a) / (-2. a. b))) 12 13 print("The three angles are ", round(A 100) / 100.0, 14 round(B . 100) / 100.0, round(C. 100) / 100.0) Enter three points: 1, 1, 6.5, 1, 6.5. 2.5 km The three angles are 15.26 90.0 74.74 Rewrite the above program by defining and calling the following two functions: Distance: that takes four numbers representing two points and returns the distance between them. Angle: that takes as arguments three sides of a triangle and returns an angle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
