Routines (alphabetical) > Routines: P > POLY_AREA

# POLY_AREA

The POLY_AREA function returns the area of a polygon given the coordinates of its vertices.

It is assumed that the polygon has n vertices with n sides and the edges connect the vertices in the order:

[(x1,y1), (x2,y2), ... , (xn,yn), (x1,y1)]

such that the last vertex is connected to the first vertex.

This routine is written in the IDL language. Its source code can be found in the file `poly_area.pro` in the `lib` subdirectory of the IDL distribution.

## Syntax

Result = POLY_AREA( X, Y [, /DOUBLE] [, /SIGNED] )

## Return Value

If either of the input arguments is double-precision or if the DOUBLE keyword is set, the result is a double-precision value, otherwise, the result is single-precision.

## Arguments

### X

An n-element vector of X coordinate locations for the vertices.

### Y

An n-element vector of Y coordinate locations for the vertices.

## Keywords

### DOUBLE

Set this keyword to use double-precision for computations and to return a double-precision result. Explicitly set DOUBLE=0 to use single-precision for computations and to return a single-precision result. By default, if either of the arguments to POLY_AREA is double-precision, computations are done in double-precision; if both arguments are single-precision, computations are done in single-precision.

### SIGNED

If set, returns a signed area. Polygons with edges traversed in counterclockwise order have a positive area; polygons traversed in the clockwise order have a negative area.

## Version History

Original | Introduced

## See Also

POLYFILLV