Next: Prism - An extrusion of a region into higher dimensions
Up: AST Class Descriptions
Previous: PolyMap - Map coordinates using polynomial functions

## Polygon - A polygonal region within a 2-dimensional Frame

Description:
The Polygon class implements a polygonal area, defined by a collection of vertices, within a 2-dimensional Frame. The vertices are connected together by geodesic curves within the encapsulated Frame. For instance, if the encapsulated Frame is a simple Frame then the geodesics will be straight lines, but if the Frame is a SkyFrame then the geodesics will be great circles. Note, the vertices must be supplied in an order such that the inside of the polygon is to the left of the boundary as the vertices are traversed. Supplying them in the reverse order will effectively negate the polygon.

Within a SkyFrame, neighbouring vertices are always joined using the shortest path. Thus if an edge of 180 degrees or more in length is required, it should be split into section each of which is less than 180 degrees. The closed path joining all the vertices in order will divide the celestial sphere into two disjoint regions. The inside of the polygon is the region which is circled in an anti-clockwise manner (when viewed from the inside of the celestial sphere) when moving through the list of vertices in the order in which they were supplied when the Polygon was created (i.e. the inside is to the left of the boundary when moving through the vertices in the order supplied).

Constructor Function:
astPolygon
Inheritance
The Polygon class inherits from the Region class.
Attributes
The Polygon class does not define any new attributes beyond those which are applicable to all Regions.
Functions
In addition to those functions applicable to all Regions, the following functions may also be applied to all Polygons:

• astDownsize: Reduce the number of vertices in a Polygon.

• astOutlineX: Create a Polygon outlining values in a pixel array

Next: Prism - An extrusion of a region into higher dimensions
Up: AST Class Descriptions
Previous: PolyMap - Map coordinates using polynomial functions

AST A Library for Handling World Coordinate Systems in Astronomy