如何计算中天?

2024-09-27 22:21:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用Wikipedia calculations得到一个中等程度的Coeli学位,但是我不能得到确切的学位。请帮帮我,怎么算?你知道吗

代码是

def medium_coeli_degree(degree):

    # Medium Coeli general formula
    # mc = arctan(tan θ / cos ε )
    # where as the θ is the degree of the planet, ε is the obliquity which is 23.43672

    radians = math.radians(degree)
    tan_theta = math.tan(radians)

    # cos ε (which is constant, the formula is provided here and general cos ε value is 0.917499911138)
    # sidereal_degree = 23.4367
    # sidereal_radian = math.radians(sidereal_degree)
    # cos_e = math.cos(sidereal_radian)
    cos_e = 0.917499911138

    # Dividing the Tan theta and Cos epsilon
    tan_by_cos = tan_theta / cos_e

    # Change the Tan by cos value into radians
    tan_by_cos_radian = math.radians(tan_by_cos)
    mc = math.atan(tan_by_cos_radian)

    return mc

最后的度数应该是0到360度,但是不能在这个范围内得到度数。你知道吗


Tags: thebyismathcosmcgeneraltheta

热门问题