methods.py 文件源码

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

项目:kharita 作者: vipyoung 项目源码 文件源码
def vector_direction_re_north(s, d):
    """
    Make the source as the reference of the plan. Then compute atan2 of the resulting destination point
    :param s: source point
    :param d: destination point
    :return: angle!
    """

    # find the new coordinates of the destination point in a plan originated at source.
    new_d_lon = d.lon - s.lon
    new_d_lat = d.lat - s.lat
    angle = -math.degrees(math.atan2(new_d_lat, new_d_lon)) + 90

    # the following is required to move the degrees from -180, 180 to 0, 360
    if angle < 0:
        angle = angle + 360
    return angle
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号