GRASS Programmer's Manual  6.4.2(2012)
area_poly1.c File Reference

GIS Library - Polygon area calculation routines. More...

#include <math.h>
#include <grass/gis.h>
#include "pi.h"
Include dependency graph for area_poly1.c:

Go to the source code of this file.

Defines

#define TWOPI   M_PI + M_PI

Functions

int G_begin_ellipsoid_polygon_area (double a, double e2)
 Begin area calculations.
double G_ellipsoid_polygon_area (const double *lon, const double *lat, int n)
 Area of lat-long polygon.

Detailed Description

GIS Library - Polygon area calculation routines.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
GRASS GIS Development Team
Date:
1999-2008

Definition in file area_poly1.c.


Define Documentation

#define TWOPI   M_PI + M_PI

Definition at line 22 of file area_poly1.c.

Referenced by G_ellipsoid_polygon_area().


Function Documentation

int G_begin_ellipsoid_polygon_area ( double  a,
double  e2 
)

Begin area calculations.

This initializes the polygon area calculations for the ellipsoid with semi-major axis a (in meters) and ellipsoid eccentricity squared e2.

Parameters:
[in]asemi-major axis
[in]e2ellipsoid eccentricity
Returns:
always returns 0

Definition at line 67 of file area_poly1.c.

Referenced by G_begin_polygon_area_calculations().

double G_ellipsoid_polygon_area ( const double *  lon,
const double *  lat,
int  n 
)

Area of lat-long polygon.

Returns the area in square meters of the polygon described by the n pairs of lat,long vertices for latitude-longitude grids.
Note: This routine assumes grid lines on the connecting the vertices (as opposed to geodesics).

Parameters:
[in]lonarray of longitudes
[in]latarray of latitudes
[in]nnumber of lat,lon pairs
Returns:
double Area in square meters

Definition at line 110 of file area_poly1.c.

References Radians, and TWOPI.

Referenced by G_area_of_polygon().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines