python - Bennett atmospheric equation -


how implement bennett atmospheric equation in python?

the equation is:

enter image description here

where h true altitude in degrees, refraction r in arc minutes

you should take mathematical functions in python.

if cot cotangent, simple script work:

import math def r(h):   return 1.02 / math.tan( h + 10.3 / (h + 5.11) ) print r(1)