[GRASS-SVN] r55803 - grass/trunk/gui/wxpython/mapdisp
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Apr 14 19:43:15 PDT 2013
Author: hamish
Date: 2013-04-14 19:43:15 -0700 (Sun, 14 Apr 2013)
New Revision: 55803
Modified:
grass/trunk/gui/wxpython/mapdisp/frame.py
Log:
fix angle math and document convention used (#1827, merge from devbr6)
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2013-04-15 02:41:39 UTC (rev 55802)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2013-04-15 02:43:15 UTC (rev 55803)
@@ -925,14 +925,16 @@
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' \
More information about the grass-commit
mailing list