00001 #include <math.h>
00002 #include "pi.h"
00003 #include <grass/gis.h>
00004
00005 static double E;
00006 static double M;
00007
00008
00009
00010
00011
00012
00031 int G_begin_zone_area_on_ellipsoid (double a,double e2,double s)
00032 {
00033 E = sqrt(e2);
00034 M = s * a * a * PI * (1 - e2) / E;
00035
00036 return 0;
00037 }
00038
00039
00040
00041
00042 double
00043 G_darea0_on_ellipsoid (register double lat)
00044 {
00045 register double x;
00046
00047 x = E * sin (Radians(lat));
00048
00049 return (M* (x/(1.0-x*x) + 0.5*log((1.0+x)/(1.0-x))));
00050 }
00051
00052
00053
00054
00055
00056
00057
00070 double G_area_for_zone_on_ellipsoid (
00071 register double north, register double south)
00072 {
00073 return (G_darea0_on_ellipsoid (north) - G_darea0_on_ellipsoid (south));
00074 }