Example 1.a Calculate tan𝜶

where 𝜶 = 91455.8
Given 12 hours equals 360 degrees, then convert 𝜶 to radians.

  1. import math
  2. def tan(a):
  3. assert len(a) == 3, 'invalid params'
  4. h = a[0]
  5. m = a[1]
  6. s = a[2]
  7. #first convert a to hours in decimals
  8. hours = h + m/60 + s/3600
  9. print('the hours: ', hours)
  10. #Then, multiplying by 15, obtain the degree
  11. degree = 15 * hours
  12. print('the degree: ', degree)
  13. #Multiplying the degree by 𝜋/180 gives a in radians
  14. radians = degree * math.pi / 180
  15. print('the radians:', radians)
  16. tana = math.tan(radians)
  17. print('the tan𝜶: ', tana)
  18. return tana
  19. ta = tan([9, 14, 55.8])
  20. print(ta)