The sum of external angles of a simple polygon is . Every simple polygon with sides can be triangulated by of its diagonals, and by the art gallery theorem its interior is visible from some of its vertices.
A simple polygon is a closed curve in the Euclidean plane consisting of straight line segments, meeting end-to-end to form a polygonal chain.[1] Two line segments meet at every endpoint, and there are no other points of intersection between the line segments. No proper subset of the line segments has the same properties.[2] The qualifier simple is sometimes omitted, with the word polygon assumed to mean a simple polygon.[3]
The line segments that form a polygon are called its edges or sides. An endpoint of a segment is called a vertex (plural: vertices)[2] or a corner. Edges and vertices are more formal, but may be ambiguous in contexts that also involve the edges and vertices of a graph; the more colloquial terms sides and corners can be used to avoid this ambiguity.[4] The number of edges always equals the number of vertices.[2] Some sources allow two line segments to form a straight angle (180°),[5] while others disallow this, instead requiring collinear segments of a closed polygonal chain to be merged into a single longer side.[6] Two vertices are neighbors if they are the two endpoints of one of the sides of the polygon.[7]
Simple polygons are sometimes called Jordan polygons, because they are Jordan curves; the Jordan curve theorem can be used to prove that such a polygon divides the plane into two regions.[8] Indeed, Camille Jordan's original proof of this theorem took the special case of simple polygons (stated without proof) as its starting point.[9] The region inside the polygon (its interior) forms a bounded set[2]topologically equivalent to an open disk by the Jordan–Schönflies theorem,[10] with a finite but nonzero area.[11] The polygon itself is topologically equivalent to a circle,[12] and the region outside (the exterior) is an unbounded connected open set, with infinite area.[11] Although the formal definition of a simple polygon is typically as a system of line segments, it is also possible (and common in informal usage) to define a simple polygon as a closed set in the plane, the union of these line segments with the interior of the polygon.[2]
A diagonal of a simple polygon is any line segment that has two polygon vertices as its endpoints, and that otherwise is entirely interior to the polygon.[13]
Properties
The internal angle of a simple polygon, at one of its vertices, is the angle spanned by the interior of the polygon at that vertex. A vertex is convex if its internal angle is less than (a straight angle, 180°) and concave if the internal angle is greater than . If the internal angle is , the external angle at the same vertex is defined to be its supplement, the turning angle from one directed side to the next. The external angle is positive at a convex vertex or negative at a concave vertex. For every simple polygon, the sum of the external angles is (one full turn, 360°). Thus the sum of the internal angles, for a simple polygon with sides is .[14]
Every simple polygon can be partitioned into non-overlapping triangles by a subset of its diagonals. When the polygon has sides, this produces triangles, separated by diagonals. The resulting partition is called a polygon triangulation.[8] The shape of a triangulated simple polygon can be uniquely determined by the internal angles of the polygon and by the cross-ratios of the quadrilaterals formed by pairs of triangles that share a diagonal.[15]
According to the two ears theorem, every simple polygon that is not a triangle has at least two ears, vertices whose two neighbors are the endpoints of a diagonal.[8] A related theorem states that every simple polygon that is not a convex polygon has a mouth, a vertex whose two neighbors are the endpoints of a line segment that is otherwise entirely exterior to the polygon. The polygons that have exactly two ears and one mouth are called anthropomorphic polygons.[16]
According to the art gallery theorem, in a simple polygon with vertices, it is always possible to find a subset of at most of the vertices with the property that every point in the polygon is visible from one of the selected vertices. This means that, for each point in the polygon, there exists a line segment connecting to a selected vertex, passing only through interior points of the polygon. One way to prove this is to use graph coloring on a triangulation of the polygon: it is always possible to color the vertices with three colors, so that each side or diagonal in the triangulation has two endpoints of different colors. Each point of the polygon is visible to a vertex of each color, for instance one of the three vertices of the triangle containing that point in the chosen triangulation. One of the colors is used by at most of the vertices, proving the theorem.[17]
Special cases
Every convex polygon is a simple polygon. Another important class of simple polygons are the star-shaped polygons, the polygons that have a point (interior or on their boundary) from which every point is visible.[2]
A monotone polygon, with respect to a straight line , is a polygon for which every line perpendicular to intersects the interior of the polygon in a connected set. Equivalently, it is a polygon whose boundary can be partitioned into two monotone polygonal chains, subsequences of edges whose vertices, when projected perpendicularly onto , have the same order along as they do in the chain.[18]
Computational problems
In computational geometry, several important computational tasks involve inputs in the form of a simple polygon.
Point in polygon testing involves determining, for a simple polygon and a query point , whether lies interior to . It can be solved in linear time; alternatively, it is possible to process a given polygon into a data structure, in linear time, so that subsequent point in polygon tests can be performed in logarithmic time.[20]
Simple formulae are known for computing the area of the interior of a polygon. These include the shoelace formula for arbitrary polygons,[21] and Pick's theorem for polygons with integer vertex coordinates.[12][22]
Constructing a triangulation of a simple polygon can also be performed in linear time, although the algorithm is complicated. A modification of the same algorithm can also be used to test whether a closed polygonal chain forms a simple polygon (that is, whether it avoids self-intersections) in linear time.[23] This also leads to a linear time algorithm for solving the art gallery problem using at most points, although not necessarily using the optimal number of points for a given polygon.[24] Although it is possible to transform any two triangulations of the same polygon into each other by flips that replace one diagonal at a time, determining whether one can do so using only a limited number of flips is NP-complete.[25]
A geodesic path,[26] the shortest path in the plane that connects two points interior to a polygon, without crossing to the exterior, may be found in linear time by an algorithm that uses triangulation as a subroutine.[27] The same is true for the geodesic center, a point in the polygon that minimizes the maximum length of its geodesic paths to all other points.[26]
The visibility polygon of an interior point of a simple polygon, the points that are directly visible from the given point by line segments interior to the polygon, can be constructed in linear time.[28] The same is true for the subset that is visible from at least one point of a given line segment.[27]
Other computational problems studied for simple polygons include constructions of the longest diagonal or the longest line segment interior to a polygon,[13] of the convex skull (the largest convex polygon within the given simple polygon),[29][30] and of various one-dimensional skeletons approximating its shape, including the medial axis[31] and straight skeleton.[32] Researchers have also studied producing other polygons from simple polygons using their offset curves,[33] unions and intersections,[11] and Minkowski sums,[34] but these operations do not always produce a simple polygon as their result. They can be defined in a way that always produces a two-dimensional region, but this requires careful definitions of the intersection and difference operations in order to avoid creating one-dimensional features or isolated points.[11]
Related constructions
According to the Riemann mapping theorem, any simply connected open subset of the plane can be conformally mapped onto a disk. Schwarz–Christoffel mapping provides a method to explicitly construct a map from a disk to any simple polygon using specified vertex angles and pre-images of the polygon vertices on the boundary of the disk. These pre-vertices are typically computed numerically.[35]
Every finite set of points in the plane that does not lie on a single line can be connected to form the vertices of a simple polygon (allowing 180° angles); for instance, one such polygon is the solution to the traveling salesperson problem.[36] Connecting points to form a polygon in this way is called polygonalization.[37]
Every simple polygon can be represented by a formula in constructive solid geometry that constructs the polygon (as a closed set including the interior) from unions and intersections of half-planes, with each side of the polygon appearing once as a half-plane in the formula. Converting an -sided polygon into this representation can be performed in time .[38]
The visibility graph of a simple polygon connects its vertices by edges representing the sides and diagonals of the polygon.[3] It always contains a Hamiltonian cycle, formed by the polygon sides. The computational complexity of reconstructing a polygon that has a given graph as its visibility graph, with a specified Hamiltonian cycle as its cycle of sides, remains an open problem.[39]
^ abcdMargalit, Avraham; Knott, Gary D. (1989). "An algorithm for computing the union, intersection or difference of two polygons". Computers & Graphics. 13 (2): 167–183. doi:10.1016/0097-8493(89)90059-9.
^Snoeyink, Jack (2017). "Point Location"(PDF). In Toth, Csaba D.; O'Rourke, Joseph; Goodman, Jacob E. (eds.). Handbook of Discrete and Computational Geometry (3rd ed.). Chapman and Hall/CRC. pp. 1005–1023.
^El Gindy, Hossam; Avis, David (1981). "A linear algorithm for computing the visibility polygon from a point". Journal of Algorithms. 2 (2): 186–197. doi:10.1016/0196-6774(81)90019-5.
^Trefethen, Lloyd N.; Driscoll, Tobin A. (1998). "Schwarz–Christoffel mapping in the computer era". Proceedings of the International Congress of Mathematicians, Vol. III (Berlin, 1998). Documenta Mathematica. pp. 533–542. MR1648186.