[GRASS-SVN] r55801 - grass/branches/develbranch_6/gui/wxpython/mapdisp
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Apr 14 19:38:37 PDT 2013
Author: hamish
Date: 2013-04-14 19:38:37 -0700 (Sun, 14 Apr 2013)
New Revision: 55801
Modified:
grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py
Log:
fix angle math and document convention used (#1827)
Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py 2013-04-15 02:19:47 UTC (rev 55800)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py 2013-04-15 02:38:37 UTC (rev 55801)
@@ -983,14 +983,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 back 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