How to calculate an angle of a right triangle given opposite and hypotenuse in Python

1 Answer

0 votes
import math 

opposite = 2.5
hypotenuse = 5
  
angle_sin = opposite / hypotenuse
right_triangle_angle = math.asin(angle_sin) * 180 / math.pi
  
print("Right Triangle Angle = " + str(right_triangle_angle))

  
  
  
  
'''
run:
  
Right Triangle Angle = 30.000000000000004
  
'''

 



answered Jul 21, 2021 by avibootz
...