[GRASS-dev] [GRASS GIS] #343: standardize DEG2RAD() etc

GRASS GIS trac at osgeo.org
Wed Oct 22 00:24:53 EDT 2008


#343: standardize DEG2RAD() etc
---------------------+------------------------------------------------------
 Reporter:  hamish   |       Owner:  grass-dev at lists.osgeo.org
     Type:  task     |      Status:  new                      
 Priority:  minor    |   Milestone:  6.4.0                    
Component:  default  |     Version:  svn-develbranch6         
 Keywords:           |    Platform:  All                      
      Cpu:  All      |  
---------------------+------------------------------------------------------
 Hi,

 in the source now there is
 {{{
 misc/m.cogo/main.c:#define DEG2RAD(a) ((a) * M_PI / 180.0)
 raster/r.param.scale/param.h:     #define DEG2RAD 0.017453293
 raster/wildfire/r.ros/spot_dist.c:#define DEG2RAD 0.017453292
 raster/r.flow/r.flow.h:#define DEG2RAD  0.0174532925199432958
 }}}

 it would be good to standardize these in gis.h just following the
 M_PI section.
 i.e. add these from m.cogo:
 {{{
 #define DEG2RAD(a) ((a) * M_PI / 180.0)
 #define RAD2DEG(a) ((a) * 180.0 / M_PI)
 #define DMS2DD(d,m,s) ((d) + ((m) / 60.0) + ((s) / 3600.0))
 }}}

  - DMS2DD bug: if deg is negative (45:30S) ->  -45  + .5  = -44.5


 ... or do the macros have to be in the same source file to be kept
 efficient?



 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/343>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list