浏览代码

fix angle math and document convention used (https://trac.osgeo.org/grass/ticket/1827, merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55803 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 12 年之前
父节点
当前提交
cc5729bd4e
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      gui/wxpython/mapdisp/frame.py

+ 4 - 2
gui/wxpython/mapdisp/frame.py

@@ -925,14 +925,16 @@ class MapFrame(SingleMapFrame):
         
         if self.Map.projinfo['proj'] == 'xy' or 'degree' not in self.Map.projinfo['unit']:
             angle = int(math.degrees(math.atan2(north,east)) + 0.5)
-            angle = 180 - angle
+            # uncomment below (or flip order of atan2(y,x) above) to use
+            #   the mathematical theta convention (CCW from +x axis)
+            #angle = 90 - angle
             if angle < 0:
                 angle = 360 + angle
             
             mstring = '%s = %s %s\n%s = %s %s\n%s = %d %s\n%s' \
                 % (_('segment'), strdist, dunits,
                    _('total distance'), strtotdist, tdunits,
-                   _('bearing'), angle, _('deg'),
+                   _('bearing'), angle, _('degrees (clockwise from grid-north)'),
                    '-' * 60)
         else:
             mstring = '%s = %s %s\n%s = %s %s\n%s' \