GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
area_ellipse.c
Go to the documentation of this file.
1
17
#include <math.h>
18
#include <grass/gis.h>
19
#include "
pi.h
"
20
21
22
static
double
E;
23
static
double
M;
24
25
26
/*
27
* a is semi-major axis, e2 is eccentricity squared, s is a scale factor
28
* code will fail if e2==0 (sphere)
29
*/
30
50
int
G_begin_zone_area_on_ellipsoid
(
double
a,
double
e2,
double
s
)
51
{
52
E = sqrt(e2);
53
M = s * a * a * M_PI * (1 - e2) / E;
54
55
return
0;
56
}
57
58
69
double
G_darea0_on_ellipsoid
(
double
lat)
70
{
71
double
x;
72
73
x = E * sin(
Radians
(lat));
74
75
return
(M * (x / (1.0 - x * x) + 0.5 *
log
((1.0 + x) / (1.0 - x))));
76
}
77
78
96
double
G_area_for_zone_on_ellipsoid
(
double
north,
double
south)
97
{
98
return
(
G_darea0_on_ellipsoid
(north) -
G_darea0_on_ellipsoid
(south));
99
}
lib
gis
area_ellipse.c
Generated on Sun Mar 16 2014 05:07:42 for GRASS Programmer's Manual by
1.8.1.2