Example 1.a Calculate tan𝜶
where 𝜶 = 91455.8
Given 12 hours equals 360 degrees, then convert 𝜶 to radians.
import mathdef tan(a):assert len(a) == 3, 'invalid params'h = a[0]m = a[1]s = a[2]#first convert a to hours in decimalshours = h + m/60 + s/3600print('the hours: ', hours)#Then, multiplying by 15, obtain the degreedegree = 15 * hoursprint('the degree: ', degree)#Multiplying the degree by 𝜋/180 gives a in radiansradians = degree * math.pi / 180print('the radians:', radians)tana = math.tan(radians)print('the tan𝜶: ', tana)return tanata = tan([9, 14, 55.8])print(ta)
