weatherservice.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:my-weather-indicator 作者: atareao 项目源码 文件源码
def get_heat_index(temperature, humidity):
    temperature = cf.s2f(temperature)
    humidity = cf.s2f(humidity)
    if humidity > 0.0 and temperature >= 77.0:
        # temperature ºF
        # humidity over 100
        c1 = -42.379
        c2 = 2.04901523
        c3 = 10.14333127
        c4 = -0.22475541
        c5 = -0.00683783
        c6 = -0.05481717
        c7 = 0.00122874
        c8 = 0.00085282
        c9 = -0.00000199
        hi = c1 + c2 * temperature + c3 * humidity + c4 * temperature *\
            humidity + c5 * math.pow(temperature, 2.0) + c6 *\
            math.pow(humidity, 2.0) + c7 * math.pow(temperature, 2.0) *\
            humidity + c8 * temperature * math.pow(humidity, 2.0) + c9 *\
            math.pow(temperature, 2.0) * math.pow(humidity, 2.0)
        return hi - temperature
    return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号