Table of contents |

2 Properties 3 Point in polygon test 4 Related links |

A simple non-convex hexagon |

A complex polygon |

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 | 10^{6} | |

googolgon | 10^{100} |

The taxonomic classification of polygons is illustrated by the following tree:

```
```

```
Polygon
/ \\
Simple Complex
/ \\
Convex Concave
/
Regular
```

- A polygon is
*simple*if it is described by a single, non-intersecting boundary; otherwise it is called*complex*. - A simple polygon is called
*convex*if it has no internal angles greater than 180° otherwise it is called*concave*. - A polygon is called
*regular*if all its sides are of equal length and all its angles are equal.

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:

- Moving around a simple
*n*-gon (like a car on a road), the amount one "turns" at a vertex is 180° - the inner angle. "Driving around" the polygon, one makes one full turn, so the sum of these turns must be 360°, from which the formula follows easily. The reasoning also applies if some inner angles are more than 180°: going clockwise around, it means that one sometime turns left instead of right, which is counted as a negative amount one turns. - Any simple
*n*-gon can be considered to be made up of (*n*-2) triangles, each of which has an angle sum of π radians or 180°.

*A*= 1/2 · (*x*_{1}*y*_{2}-*x*_{2}*y*_{1}+*x*_{2}*y*_{3}-*x*_{3}*y*_{2}+ ... +*x*_{n}*y*_{1}-*x*_{1}*y*_{n})- = 1/2 · (
*x*_{1}(*y*_{2}-*y*_{n}) +*x*_{2}(*y*_{3}-*y*_{1}) +*x*_{3}(*y*_{4}-*y*_{2}) + ... +*x*_{n}(*y*_{1}-*y*_{n-1}))

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* = (*x*_{0},*y*_{0}) 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.

- Set
*l*:= 0 and*r*:= 0 - for each line segment
*L*of the polygon do the following:- if the
*y*-coordinate of one endpoint of*L*is less than*y*_{0}and the other is greater than or equal to*y*_{0}, then:- if
*P*lies in the half plane to the left of*L*, then set*l*:=*l*+ 1, else set*r*:=*r*+ 1 (*)

- if

- if the
- if both
*l*and*r*are odd, then*P*lies inside the polygon; if both*l*and*r*are even, then*P*lies outside the polygon; if one is even and the other is odd, then some error has occurred, e.g. a rounding error or the line segments do not form a closed path.

`eps`

and test in line (*) whether `eps`

of geometric shape, polyhedron, polytope, cyclic polygon, synthetic geometry.