[GRASS-CVS] hamish: grass6/raster/r.coin prnt_entry.c,2.0,2.0.6.1
grass at intevation.de
grass at intevation.de
Fri Nov 16 06:15:17 EST 2007
Author: hamish
Update of /grassrepository/grass6/raster/r.coin
In directory doto:/tmp/cvs-serv1020/grass6/raster/r.coin
Modified Files:
Tag: releasebranch_6_2
prnt_entry.c
Log Message:
more precise conversions to square miles and acres
(merge from HEAD)
Index: prnt_entry.c
===================================================================
RCS file: /grassrepository/grass6/raster/r.coin/prnt_entry.c,v
retrieving revision 2.0
retrieving revision 2.0.6.1
diff -u -d -r2.0 -r2.0.6.1
--- prnt_entry.c 9 Nov 2004 14:13:55 -0000 2.0
+++ prnt_entry.c 16 Nov 2007 11:15:15 -0000 2.0.6.1
@@ -1,8 +1,10 @@
#include "coin.h"
#define F_CTOK(C) ((double)(C))/1000000.0
-#define F_CTOM(C) F_CTOK(C) * 0.3861
-#define F_CTOA(C) F_CTOK(C) * 247.1000
+ /* sq km -> sq miles = 1000^2 / (0.0254 * 12 * 5280)^2 */
+#define F_CTOM(C) F_CTOK(C) * 0.386102158542446
+ /* sq km -> acres = sq miles * 640 */
+#define F_CTOA(C) F_CTOK(C) * 247.105381467165
#define F_CTOH(C) F_CTOK(C) * 100.0000
#define F_CTOP(C,R) ((int)R) ? (double)C / (double)R * 100.0 : 0.0
More information about the grass-commit
mailing list