计算太阳赤纬 和 太阳日落时角

import math as m

def Declination(n):
    """
     计算太阳赤纬
    :param n: 月份天数
    :return: 赤纬角度
    """

    a = 23.45*m.sin(m.radians(360*(284+n)/365))
    return a

a = Declination(31)

print("{:.3f}".format(a))

def Sunrise_hour_angle(d):
    """
    计算太阳日落时角
    :param d: 太阳赤纬
    :return: 太阳日落时角w_s
    """


    # 苏州地区纬度31.3°
    a = m.radians(d)
    b = m.tan(m.radians(-31.3))
    c = m.tan(a)
    w = m.acos(b*c)
    w_s = m.degrees(w)


    return w_s

w_s = Sunrise_hour_angle(-17.78)

print("{:.3f}".format(w_s))

猜你喜欢

转载自www.cnblogs.com/hgrhome/p/11715415.html