Table of contents |
2 Properties 3 Point in polygon test 4 Related links |
Polygon names | ||
---|---|---|
Name | Sides | |
triangle | 3 | |
quadrilateral | 4 | |
pentagon | 5 | |
hexagon | 6 | |
heptagon | 7 | |
octagon | 8 | |
nonagon or ennagon | 9 | |
decagon | 10 | |
hendecagon or undecagon | 11 | |
dodecagon | 12 | |
hectagon | 100 | |
megagon | 106 | |
googolgon | 10100 |
The taxonomic classification of polygons is illustrated by the following tree:
Polygon
/ \\
Simple Complex
/ \\
Convex Concave
/
Regular
For example, a square is a regular, cyclic quadrilateral.
We will assume Euclidean geometry throughout.
Any polygon, regular or irregular, complex or simple, has as many angles as it has sides. The sum of the inner angles of a simple n-gon is (n-2)&pi radians (or (n-2)180°), and the inner angle of a regular n-gon is (n-2)π/n radians (or (n-2)180°/n). This can be seen in two different ways:
Properties
The area A of a simple polygon can be computed if the cartesian coordinates (x1, y1), (x2, y2), ..., (xn, yn) of its vertices, listed in order as the area is circulated in counter-clockwise fashion, are known. The formula is
If any two simple polygons of equal area are given, then the first can be cut into polygonal pieces which can be reassembled to form the second polygon. This is the Bolyai-Gerwien theorem.
All regular polygons are concyclic, as are all triangles and rectangles (see circumcircle).
The question of which regular polygons can be constructed with ruler and compass alone was settled by Carl Friedrich Gauss in 1796 (sufficiency)and Pierre Wantzel in 1836 (necessity): A regular n-gon can be constructed with ruler and compass if and only if the odd prime factors of n are distinct prime numbers of the form
In computer graphics and computational geometry, it is often necessary to determine whether a given point P = (x0,y0) lies inside a simple polygon given by a sequence of line segments. The following algorithm counts how often a horizontal half-ray starting at P intersects the polygon; that number is odd if and only if P lies inside the polygon.
Point in polygon test
This algorithm does not always produce the correct answer if P lies directly on the polygon's boundary; if implemented on a computer with floating point arithmetic, the results may also be wrong if the point lies very close to that boundary, because of rounding errors. This is not normally a concern, as speed is much more important than complete accuracy in computer graphics. However, for a formally correct program, one would have to introduce a numerical tolerance eps
and test in line (*) whether P lies withing eps
of L, in which case the algorithm should stop and report "P lies very close to the boundary."
geometric shape, polyhedron, polytope, cyclic polygon, synthetic geometry.Related links