[GRASS-SVN] r34862 - grass-addons/raster/r.viewshed

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 14 04:37:35 EST 2008


Author: hamish
Date: 2008-12-14 04:37:34 -0500 (Sun, 14 Dec 2008)
New Revision: 34862

Modified:
   grass-addons/raster/r.viewshed/statusstructure.cc
   grass-addons/raster/r.viewshed/statusstructure.h
Log:
use M_PI

Modified: grass-addons/raster/r.viewshed/statusstructure.cc
===================================================================
--- grass-addons/raster/r.viewshed/statusstructure.cc	2008-12-14 04:20:48 UTC (rev 34861)
+++ grass-addons/raster/r.viewshed/statusstructure.cc	2008-12-14 09:37:34 UTC (rev 34862)
@@ -75,9 +75,9 @@
     /*calculate and return the angle in degrees */
     assert(fabs(sn.dist2vp) > 0.001);
     if (diffElev >= 0.0)
-	return (atan(sn.dist2vp / diffElev) * (180 / PI));
+	return (atan(sn.dist2vp / diffElev) * (180 / M_PI));
     else
-	return ((atan(fabs(diffElev) / sn.dist2vp) * (180 / PI)) + 90);
+	return ((atan(fabs(diffElev) / sn.dist2vp) * (180 / M_PI)) + 90);
 }
 
 

Modified: grass-addons/raster/r.viewshed/statusstructure.h
===================================================================
--- grass-addons/raster/r.viewshed/statusstructure.h	2008-12-14 04:20:48 UTC (rev 34861)
+++ grass-addons/raster/r.viewshed/statusstructure.h	2008-12-14 09:37:34 UTC (rev 34862)
@@ -52,8 +52,6 @@
 #include "rbbst.h"
 #include "visibility.h"
 
-#define PI 3.1416
-
 typedef struct statusnode_
 {
     dimensionType row, col;	/*position of the cell */



More information about the grass-commit mailing list