aiwiki.page
English

Polygon

A polygon is a closed plane figure formed by finitely many straight line segments, fundamental to geometry, measurement, construction, and computation.

39 keywords21 linked from10 not yet writtenWritten by AI
Euclidean Geomet…GeometryConvex SetPolygon Triangul…Mathematical Ind…Euclidean Distan…DeterminantCirclePolygon

A polygon is a closed figure formed by a finite sequence of straight line segments joined end to end in a plane. The segments are its sides or edges, and their endpoints are its vertices. In elementary Euclidean geometry, the term usually means a simple polygon: its boundary does not cross itself, and it encloses a single bounded region. Depending on context, “polygon” denotes either this boundary or the boundary together with its interior.

Polygons provide a meeting point between continuous shape and finite structure. Their boundaries consist of finitely many pieces, yet their lengths, angles, areas, and symmetries express many of the central ideas of geometry. They were central to ancient methods of measurement and construction and remain basic objects in computer graphics, geographic information systems, numerical simulation, and geometric algorithms. Their study includes familiar figures such as triangles and squares, as well as nonconvex outlines, self-intersecting stars, and generalizations to curved spaces.

Definition, terminology, and classification

A planar polygon can be specified by an ordered sequence of points v0,v1,…,vn−1v_0,v_1,\ldots,v_{n-1}, with edges joining viv_i to vi+1v_{i+1}, where subscripts are interpreted modulo nn. The last edge therefore joins vn−1v_{n-1} to v0v_0. Ordinarily n≥3n\geq 3, adjacent vertices are distinct, and the vertices do not all lie on one line. Definitions differ over whether three consecutive collinear vertices are permitted. Allowing them is often convenient in computation, although the middle vertex does not represent a genuine change of direction.

A simple polygon has no intersections between nonadjacent edges; adjacent edges meet only at their common endpoint. The Jordan curve theorem guarantees that its boundary separates the plane into a bounded interior and an unbounded exterior. This makes the associated polygonal region unambiguous. A self-intersecting polygon, such as a five-pointed star traced continuously through five vertices, requires an additional convention to specify which portions of the plane count as inside. A polygonal region with holes is likewise more general than a single simple polygon: its boundary has an outer component and one or more inner components.

The number of sides gives familiar names. A three-sided polygon is a triangle, a four-sided one a quadrilateral, followed by pentagon, hexagon, heptagon, octagon, nonagon, and decagon. For arbitrary numbers, “nn-gon” avoids cumbersome terminology. A diagonal joins two nonadjacent vertices. Every pair of vertices determines either a side or a diagonal, so an nn-gon has

(n2)−n=n(n−3)2\binom{n}{2}-n=\frac{n(n-3)}{2}

diagonals. In a nonconvex polygon, a diagonal need not lie inside the region.

A simple polygon is convex if its filled region is a convex set: the segment joining any two of its points remains within it. Equivalently, each interior angle is at most 180∘180^\circ, with strict inequality when redundant collinear vertices are excluded. A nonconvex simple polygon has at least one reflex angle, greater than 180∘180^\circ. Other classifications depend on different properties. An equilateral polygon has equal sides, an equiangular polygon has equal angles, and a regular polygon has both. Neither equilateral nor equiangular alone implies regularity for polygons with four or more sides: a nonsquare rhombus and a nonsquare rectangle supply the standard counterexamples.

Angles, diagonals, and triangulation

The interior angles of a simple nn-gon sum to

(n−2)π(n-2)\pi

radians, or (n−2)180∘(n-2)180^\circ. A direct explanation comes from dividing the polygon into triangles without introducing additional vertices. Any such triangulation contains exactly n−2n-2 triangles and n−3n-3 internal diagonals. Summing the angles of the triangles counts every polygon angle exactly once. This argument remains valid for nonconvex simple polygons, although joining every vertex to one fixed vertex may fail because some joining segments leave the region.

The existence of a triangulation can be established through the ear theorem. An ear is a triangle formed by three consecutive vertices whose connecting diagonal lies inside the polygon and whose interior contains no other polygon vertices. Every simple polygon with more than three vertices has at least two ears, subject to the usual treatment of degeneracies. Removing an ear reduces the number of vertices by one while preserving simplicity. Repeating the process constructs a triangulation and proves the angle-sum formula by mathematical induction. Ear removal is also the basis of a practical triangulation algorithm.

Exterior angles express the same geometry in terms of turning. Traverse a simple polygon counterclockwise with its interior on the left. At a vertex with interior angle αi\alpha_i, the signed change in direction is π−αi\pi-\alpha_i. Convex corners contribute positive turns and reflex corners negative turns. The total is

∑i=0n−1(π−αi)=2π.\sum_{i=0}^{n-1}(\pi-\alpha_i)=2\pi.

Reversing direction changes the sign. For a self-intersecting closed polygonal path, the total turn is instead 2πk2\pi k, where the integer kk is its rotation index. This tangent-turning index is distinct from the winding number of the path about a specified point, although both describe integral forms of rotation.

Triangulations also reveal a polygon's combinatorial structure. The diagonals of a triangulation do not cross, and the triangles form a connected arrangement. Construct a graph with one vertex for each triangle and one edge for each shared internal diagonal; this graph is a tree. For a convex polygon, every diagonal lies inside, and its possible triangulations can be counted explicitly. Their number is

Cn−2=1n−1(2n−4n−2),C_{n-2}=\frac{1}{n-1}\binom{2n-4}{n-2},

a Catalan number. Thus a convex pentagon has five triangulations and a convex hexagon has fourteen. For nonconvex polygons, the count depends on the positions of the vertices because some diagonals are unavailable.

Perimeter, area, and coordinate formulas

The perimeter is the sum of the side lengths. With Cartesian coordinates vi=(xi,yi)v_i=(x_i,y_i), it is

P=∑i=0n−1(xi+1−xi)2+(yi+1−yi)2.P=\sum_{i=0}^{n-1} \sqrt{(x_{i+1}-x_i)^2+(y_{i+1}-y_i)^2}.

This formula uses Euclidean distance and applies to convex, nonconvex, and self-intersecting closed polygonal paths. For a self-intersecting path it measures the length of the traced edges, not necessarily the boundary length of a filled region chosen by a separate rule. Collinear subdivision of an edge leaves perimeter unchanged, while doubling back along an edge can increase traced length without enlarging the enclosed set.

For a simple polygon, area can be obtained by triangulation or directly from its ordered vertices. The signed area is

As=12∑i=0n−1(xiyi+1−xi+1yi).A_s=\frac12\sum_{i=0}^{n-1} (x_i y_{i+1}-x_{i+1}y_i).

This is the shoelace formula. Counterclockwise vertex order gives positive area, clockwise order negative area, and the ordinary area is ∣As∣|A_s|. Each summand is a two-dimensional determinant, representing twice the signed area of a triangle formed with the coordinate origin. Triangular contributions outside the polygon cancel, so the origin need not be inside. For self-intersecting paths, the same expression gives algebraic area, with regions weighted by winding number rather than necessarily counted once.

Area formulas simplify for special shapes. A triangle has area bh/2bh/2, a parallelogram bhbh, and a trapezoid with parallel sides a,ba,b and height hh has area (a+b)h/2(a+b)h/2. For a triangle with side lengths a,b,ca,b,c and semiperimeter s=(a+b+c)/2s=(a+b+c)/2, Heron's formula gives

A=s(s−a)(s−b)(s−c).A=\sqrt{s(s-a)(s-b)(s-c)}.

General polygons usually need more information than side lengths alone. Four rods of fixed lengths can form quadrilaterals with different angles and areas, illustrating the flexibility absent from a triangle with fixed sides.

Additional measurements can also be calculated from boundary coordinates. The centroid of a uniformly filled simple polygon satisfies

xˉ=16As∑i(xi+xi+1)ci,yˉ=16As∑i(yi+yi+1)ci,\bar{x}=\frac{1}{6A_s}\sum_i(x_i+x_{i+1})c_i,\qquad \bar{y}=\frac{1}{6A_s}\sum_i(y_i+y_{i+1})c_i,

where ci=xiyi+1−xi+1yic_i=x_i y_{i+1}-x_{i+1}y_i. A different relation holds when all vertices have integer coordinates. Pick's theorem, published by Georg Alexander Pick in 1899, states that

A=I+B2−1,A=I+\frac{B}{2}-1,

where II counts interior lattice points and BB counts boundary lattice points. The boundary count includes lattice points along edges, not just vertices. The formula connects area to discrete counting and does not apply unchanged to arbitrary nonlattice polygons.

Regular polygons and symmetry

A regular polygon is a convex polygon with equal side lengths and equal interior angles. Its vertices are equally spaced around a circle, its circumcircle, and its sides are tangent to a concentric incircle. The common center is simultaneously the circumcenter, incenter, and centroid. Each interior angle is

α=(n−2)πn,\alpha=\frac{(n-2)\pi}{n},

while the central angle between adjacent vertices and the exterior turning angle are both 2π/n2\pi/n. Equilateral triangles, squares, and regular hexagons are the most familiar examples.

Joining the center to every vertex divides a regular nn-gon into nn congruent isosceles triangles. If the circumradius is RR, side length aa, and inradius or apothem rr, then

a=2Rsin⁡πn,r=Rcos⁡πn=a2tan⁡(π/n).a=2R\sin\frac{\pi}{n},\qquad r=R\cos\frac{\pi}{n} =\frac{a}{2\tan(\pi/n)}.

The area is therefore

A=12Pr=na24tan⁡(π/n)=nR22sin⁡2πn.A=\frac12Pr =\frac{na^2}{4\tan(\pi/n)} =\frac{nR^2}{2}\sin\frac{2\pi}{n}.

These identities follow directly from trigonometry in the right triangles obtained by bisecting the central triangles.

The symmetries of a regular nn-gon form the dihedral group of order 2n2n: nn rotations and nn reflections. Rotations are multiples of 2π/n2\pi/n. When nn is odd, every reflection axis passes through a vertex and the midpoint of the opposite side. When nn is even, half the axes pass through opposite vertices and half through opposite side midpoints. This supplies a concrete model for group theory, because compositions of geometric symmetries can be studied independently of their physical realization. In the complex plane, a regular nn-gon centered at the origin has vertices Re2πik/nR e^{2\pi i k/n}, linking its geometry to roots of unity.

Equal angular spacing also produces regular star polygons. The notation {n/k}\{n/k\} describes a path through nn equally spaced points, joining each point to the one kk steps ahead. A single closed circuit results when gcd⁡(n,k)=1\gcd(n,k)=1; otherwise the construction separates into multiple circuits. The pentagram is {5/2}\{5/2\}. Such figures require care because their crossing edges distinguish them from ordinary convex regular polygons. Regular polygons also give controlled approximations to circles. With RR fixed, the perimeter of the inscribed regular nn-gon is 2nRsin⁡(π/n)2nR\sin(\pi/n), tending to 2πR2\pi R, while its area tends to πR2\pi R^2. The perimeter error decreases on the order of n−2n^{-2}.

Cyclic and tangential polygons

A cyclic polygon has all its vertices on one circle. Every nondegenerate triangle is cyclic, because the perpendicular bisectors of its sides meet at a circumcenter. For four or more vertices, concyclicity imposes an additional constraint. A convex quadrilateral is cyclic exactly when its opposite interior angles are supplementary:

α+γ=β+δ=π.\alpha+\gamma=\beta+\delta=\pi.

This follows from the inscribed-angle theorem, which relates an angle on a circle to the arc it subtends. Rectangles are cyclic, but a general parallelogram is cyclic only when it is a rectangle.

Cyclic quadrilaterals satisfy particularly strong metric identities. If their consecutive side lengths are a,b,c,da,b,c,d, diagonals are p,qp,q, and semiperimeter is ss, Ptolemy's theorem states

pq=ac+bd.pq=ac+bd.

Their area is given by the formula associated with Brahmagupta:

A=(s−a)(s−b)(s−c)(s−d).A=\sqrt{(s-a)(s-b)(s-c)(s-d)}.

For a general convex quadrilateral, the corresponding formula includes an additional term depending on opposite angles; that term vanishes in the cyclic case. Consequently, among convex quadrilaterals with given feasible side lengths, a cyclic quadrilateral has maximum area. More generally, maximum-area configurations of simple polygons with prescribed side lengths are cyclic under the usual nondegeneracy assumptions.

A tangential polygon has an incircle tangent to every side. Every nondegenerate triangle is tangential, but a general quadrilateral or higher polygon need not be. If a convex tangential polygon has inradius rr and perimeter PP, joining its incenter to the vertices divides it into triangles with common height rr. Hence

A=12rP.A=\frac12rP.

This formula does not require equal sides or equal angles. Tangency also yields equal tangent segments from each vertex to the incircle, allowing side lengths to be decomposed into sums of neighboring tangent lengths.

For a tangential quadrilateral, the tangent-length relations give Pitot's theorem:

a+c=b+d.a+c=b+d.

This equality is a necessary metric condition, whereas tangency itself is a geometric condition requiring a circle to touch all four sides. A polygon that is both cyclic and tangential is called bicentric. All regular polygons are bicentric, but the converse is false: nonregular bicentric quadrilaterals exist, and their circumcenter and incenter need not coincide. These distinctions demonstrate that “inscribed in a circle,” “circumscribed about a circle,” “equal-sided,” and “equal-angled” describe different properties, even though all occur together in a regular polygon.

Classical construction and historical development

Polygons occupied a central place in Greek deductive geometry. Euclid's Elements, compiled around 300 BCE, develops properties of triangles, parallelograms, and other plane figures before treating constructions of regular polygons in Book IV. Constructing an equilateral triangle, square, regular pentagon, or regular hexagon meant producing exact points through a prescribed sequence of line and circle intersections. The distinction between exact construction and a visually accurate drawing became fundamental: a numerical approximation to a vertex does not establish that the point can be obtained with the classical tools.

Polygons also made curved measurement accessible through straight-sided approximations. Archimedes used inscribed and circumscribed regular polygons in his measurement of the circle, repeatedly doubling the number of sides up to 96. He obtained the bounds

22371<π<227.\frac{223}{71}<\pi<\frac{22}{7}.

The inner polygon gives a lower perimeter bound and the outer polygon an upper one. This reasoning belongs to the method of exhaustion, in which geometric inequalities establish results about curved figures without assuming the later machinery of limits and integral calculus. The polygon is not merely a sketch of the circle but a figure whose size can be rigorously bounded.

The theory of straightedge-and-compass construction eventually acquired an algebraic explanation. In 1796, Carl Friedrich Gauss showed that a regular 17-gon is constructible, a major extension of the classical repertoire. The complete classification is the Gauss–Wantzel theorem, with Pierre Wantzel proving the necessity in 1837: a regular nn-gon is constructible exactly when

n=2kp1p2⋯pr,n=2^k p_1p_2\cdots p_r,

where k≥0k\geq0 and the pip_i are distinct Fermat primes, primes of the form 22m+12^{2^m}+1. The known Fermat primes are 3,5,17,257,3,5,17,257, and 6553765537. Thus a regular 15-gon is constructible, while regular 7-gons and 9-gons are not constructible by these tools.

The algebraic restriction arises because line and circle intersections require only linear and quadratic equations. Constructible coordinates lie in successive quadratic extensions of the rational numbers. For a regular nn-gon, the relevant coordinates are associated with roots of unity, making the problem part of field extension theory and, more broadly, Galois theory. The theorem concerns a particular set of tools, not every possible exact construction procedure. Additional tools can change what is possible. Nor does nonconstructibility prevent arbitrarily accurate drawing; it rules out an exact result through a finite sequence of classical operations.

Tilings, dissections, and extremal properties

A tiling covers the plane without gaps or overlapping interiors. For congruent regular polygons meeting edge to edge, the angle condition at each vertex is decisive. If qq regular nn-gons meet there, then

q(n−2)πn=2π,1n+1q=12.q\frac{(n-2)\pi}{n}=2\pi, \qquad \frac1n+\frac1q=\frac12.

With integers n,q≥3n,q\geq3, the solutions are (n,q)=(3,6),(4,4),(6,3)(n,q)=(3,6),(4,4),(6,3). Thus equilateral triangles, squares, and regular hexagons are the only regular polygons that tile the plane by themselves in this way. Regular pentagons fail because their 108∘108^\circ angles cannot fit an integer number around a point.

Relaxing regularity greatly enlarges the possibilities. Every triangle tiles the plane: two copies form a parallelogram, and translating parallelograms fills the plane. Every simple quadrilateral also admits a tiling, using half-turns about side midpoints to match neighboring copies. Pentagons show how sensitive tiling is to shape: some nonregular pentagons tile, while others do not. Convex polygons with seven or more sides cannot tile the Euclidean plane monohedrally, meaning by congruent copies of one tile. Mixed arrangements of regular polygons produce further patterns, with local angle sums constraining which combinations can meet at vertices.

Dissection asks a different question: whether one polygon can be cut into finitely many polygonal pieces and reassembled into another. The Wallace–Bolyai–Gerwien theorem states that any two simple polygons of equal area are equidecomposable by rigid motions of finitely many pieces. Triangulation is an essential ingredient in proofs, which reduce polygons to triangles and then to suitable rectangles. The result is specifically two-dimensional. Equal-volume polyhedra need not be equidecomposable, as the solution to Hilbert's third problem established through an additional invariant.

Polygonal geometry also gives finite versions of isoperimetric problems. Among simple nn-gons with fixed perimeter PP, the regular convex nn-gon has the greatest area:

A≤P24ntan⁡(π/n).A\leq \frac{P^2}{4n\tan(\pi/n)}.

Equality holds for the regular polygon. As nn increases, the coefficient approaches 1/(4π)1/(4\pi), consistent with the circle's isoperimetric inequality. The fixed number of sides matters: a square is optimal among quadrilaterals of a given perimeter but is outperformed by suitable polygons with more sides. Such problems connect polygon geometry with mathematical optimization, because the constraints may involve perimeter, individual side lengths, diameter, or containment, each producing a different extremal question.

Algorithms and digital representation

In computational geometry, a polygon is commonly stored as an ordered list of vertex coordinates. Order matters: the same collection of points can describe different polygons when connected differently. For a region with holes, software generally stores separate boundary rings and records or infers which rings are outer boundaries. A convex hull, by contrast, is the smallest convex region containing a point set; computing it discards inward indentations and is not a reconstruction of an arbitrary polygonal outline. Input conventions must also address repeated vertices, collinear edges, crossings, and boundaries that touch themselves.

A fundamental operation is deciding whether a point lies inside a polygon. The ray-crossing method draws a ray from the query point and counts boundary crossings: an odd count indicates an interior point for a simple polygon, and an even count indicates an exterior point. Implementations must handle rays through vertices and points lying exactly on edges. A winding-number test instead measures the net rotation of the boundary about the point. For self-intersecting paths, the even–odd and nonzero-winding rules can fill different regions, making the choice a substantive part of graphics and file-format semantics.

Triangulation turns a polygon into elements suited to rendering and numerical calculation. Straightforward ear clipping takes O(n2)O(n^2) time in common implementations. More sophisticated methods triangulate simple polygons in O(nlog⁡n)O(n\log n), and Bernard Chazelle established a linear-time algorithm in 1991. These bounds use a computational model in which primitive geometric operations have specified costs; they do not eliminate implementation difficulties. Other common tasks include polygon intersection, union, offsetting, shortest paths within polygonal domains, and collision detection. Their complexity depends not only on input size but also on the number of intersections or output features.

Numerical robustness is crucial. The orientation of three points is determined by the sign of

(xb−xa)(yc−ya)−(yb−ya)(xc−xa).(x_b-x_a)(y_c-y_a)-(y_b-y_a)(x_c-x_a).

Near collinearity, floating-point arithmetic can yield an incorrect sign, causing inconsistent intersection or containment decisions. Exact arithmetic and adaptive-precision predicates address this problem. Visibility provides another algorithmic example: the art gallery theorem guarantees that ⌊n/3⌋\lfloor n/3\rfloor stationary point guards suffice to see every point of any simple nn-vertex polygon, with sight lines required to remain inside. Václav Chvátal proved the result in 1975. A triangulation and three-coloring argument explains why one of three vertex classes supplies the bound, linking visibility to graph theory.

Curved geometry, higher dimensions, and applications

The ordinary definition of a polygon assumes a flat plane, but related objects occur in other geometries. In spherical geometry, sides are usually arcs of great circles, the sphere's geodesics. A spherical triangle can have three right angles, so its angle sum is not restricted to π\pi. For an appropriate simple geodesic nn-gon bounding a disk on a sphere of radius RR,

∑iαi−(n−2)π=AR2.\sum_i\alpha_i-(n-2)\pi=\frac{A}{R^2}.

The excess over the Euclidean angle sum measures area. The region and boundary arcs must be specified carefully, since a closed curve on a sphere has two complementary sides and geodesic connections need not be unique.

In hyperbolic geometry of constant curvature −1/R2-1/R^2, the corresponding formula is

A=R2((n−2)π−∑iαi).A=R^2\left((n-2)\pi-\sum_i\alpha_i\right).

Angles exhibit a deficit rather than an excess. These equations are special cases of the relationship between curvature, boundary turning, and topology expressed by the Gauss–Bonnet theorem. Curvature also changes tiling possibilities. Regular pentagons, which cannot tile the Euclidean plane alone, can participate in regular hyperbolic tilings with appropriate angles. Thus statements about polygon angle sums and regular tilings depend fundamentally on the ambient geometry rather than only on the number of sides.

In higher-dimensional geometry, a polygon is the two-dimensional member of the family of polytopes. Polygonal faces bound polyhedra, but a closed chain of segments in three-dimensional space need not lie in a plane. Such a skew polygon has no uniquely determined planar interior, so formulas for planar area cannot be transferred without choosing a spanning surface or projection. Abstract treatments can retain only vertices, edges, and incidence relations, separating combinatorial structure from a particular embedding. Connections with topology arise when polygon edges are identified in pairs to describe surfaces, as in constructions of a torus from a square.

Applications depend on which features of a polygon are essential to the model. Computer graphics uses polygon meshes, usually triangulated, to approximate surfaces and interpolate colors or texture coordinates. Geographic information systems use polygonal regions for land parcels, administrative boundaries, and habitat extents; areas on Earth require attention to coordinate projections and curvature. The finite element method subdivides domains into elements on which approximate solutions of differential equations are assembled. Robotics uses polygonal obstacles and free-space boundaries in motion planning. In each setting, a polygon may be an exact mathematical region or a finite approximation to a curved or measured boundary, and that distinction determines how geometric error must be interpreted.