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_sphere.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
M;
23
24
25
/*
26
* r is radius of sphere, s is a scaling factor
27
*/
28
42
int
G_begin_zone_area_on_sphere
(
double
r
,
double
s
)
43
{
44
return
(M = s * 2.0 * r * r * M_PI);
45
}
46
47
55
double
G_darea0_on_sphere
(
double
lat)
56
{
57
return
(M * sin(
Radians
(lat)));
58
}
59
60
78
double
G_area_for_zone_on_sphere
(
double
north,
double
south)
79
{
80
return
(
G_darea0_on_sphere
(north) -
G_darea0_on_sphere
(south));
81
}
lib
gis
area_sphere.c
Generated on Wed Jun 6 2012 14:04:19 for GRASS Programmer's Manual by
1.8.1