geomath.py 文件源码

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

项目:qgis-shapetools-plugin 作者: NationalSecurityAgency 项目源码 文件源码
def atan2d(y, x):
    """compute atan2(y, x) with the result in degrees"""

    if abs(y) > abs(x):
      q = 2; x, y = y, x
    else:
      q = 0
    if x < 0:
      q += 1; x = -x
    ang = math.degrees(math.atan2(y, x))
    if q == 1:
      ang = (180 if y >= 0 else -180) - ang
    elif q == 2:
      ang =  90 - ang
    elif q == 3:
      ang = -90 + ang
    return ang
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号