TSE.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Mathematics · Geometry · Plane Geometry

Regular Polygon Calculator

Calculates the perimeter, area, interior angle, exterior angle, apothem, and diagonal count of any regular polygon given the number of sides and side length.

Calculator

Advertisement

Formula

A = area of the polygon; n = number of sides (integer ≥ 3); s = length of one side; P = perimeter; θ_int = interior angle at each vertex; θ_ext = exterior angle at each vertex; a = apothem (perpendicular distance from center to midpoint of a side); D = number of distinct diagonals. The cotangent factor cot(π/n) arises from the geometry of the isoceles triangles that tile the polygon.

Source: Weisstein, E. W. 'Regular Polygon.' MathWorld — A Wolfram Web Resource. https://mathworld.wolfram.com/RegularPolygon.html

How it works

A regular polygon is a closed plane figure with n equal sides and n equal interior angles. Because every side and every vertex is identical, a single side length s and the side count n fully determine every other geometric property. The polygon can be divided into n congruent isoceles triangles, each with its apex at the centre of the polygon and base equal to s. This decomposition is the geometric foundation for all the formulas used here.

The area is given by A = (n·s²/4)·cot(π/n), which sums the areas of those n central triangles. The perimeter is simply P = n·s. Each interior angle equals (n−2)·180°/n, derived from the fact that the sum of interior angles in any simple polygon is (n−2)·180°. The complementary exterior angle is 360°/n. The apothem — the perpendicular from the centre to the midpoint of any side — equals (s/2)·cot(π/n) and is critical for area and volume calculations. The circumradius R = s / (2·sin(π/n)) is the radius of the circumscribed circle passing through all vertices. Finally, the number of diagonals D = n(n−3)/2 counts all line segments connecting non-adjacent vertices.

These formulas are used in structural engineering (hex bolt geometry, cross-section analysis), urban planning (roundabout and plaza design), computer graphics (polygon mesh generation), crystallography, and game development. Architects use apothem calculations to determine inscribed circle radii for dome footprints; civil engineers use interior angles to cut pavement sections; educators use the formulas to teach the bridge between algebra and geometry.

Worked example

Suppose you are designing a gazebo with a regular hexagonal (n = 6) floor plan, and each side measures s = 3.0 m.

Step 1 — Perimeter: P = 6 × 3.0 = 18.0 m. This is the total length of decking required around the perimeter.

Step 2 — Interior angle: θ_int = (6 − 2) × 180° / 6 = 4 × 180° / 6 = 120°. Each corner of the hexagon meets at 120°, which is why regular hexagons tile a flat plane perfectly.

Step 3 — Exterior angle: θ_ext = 360° / 6 = 60°.

Step 4 — Apothem: a = (3.0 / 2) × cot(π/6) = 1.5 × cot(30°) = 1.5 × √3 ≈ 2.5981 m. This is the perpendicular distance from the centre post to any wall panel — needed to size the roof rafters.

Step 5 — Area: A = (6 × 9) / 4 × cot(π/6) = 13.5 × √3 ≈ 23.3827 m². This is the usable floor area of the gazebo.

Step 6 — Circumradius: R = 3.0 / (2 × sin(π/6)) = 3.0 / (2 × 0.5) = 3.0 m. For a regular hexagon, the circumradius equals the side length — a useful cross-check.

Step 7 — Diagonals: D = 6 × (6 − 3) / 2 = 18 / 2 = 9. There are 9 distinct diagonals, including the 3 long diameters through the centre.

Limitations & notes

This calculator requires n ≥ 3; values of 1 or 2 do not produce valid polygons. All formulas assume a perfectly regular polygon — equal sides and equal angles — so they do not apply to irregular polygons. For very large values of n (approaching a circle), the area formula converges to πR², which provides a useful sanity check. The formulas assume a flat Euclidean plane; they do not account for curvature effects in geodesic or spherical geometry. Side lengths and areas share the same linear unit (metres, feet, etc.), so be consistent with your input units. The number of diagonals formula produces a non-integer result for n = 1 or n = 2, confirming these are degenerate cases. When using results for engineering purposes, always apply appropriate safety factors and verify against project-specific standards.

Frequently asked questions

What is the apothem of a regular polygon and why does it matter?

The apothem is the perpendicular distance from the centre of the polygon to the midpoint of any side. It equals (s/2)·cot(π/n). The apothem is important because the area can also be expressed as A = (1/2)·P·a, where P is the perimeter, making it a key bridge between perimeter and area calculations. In engineering, the apothem determines the inscribed circle radius — for example, the wrench size (across-flats dimension) on a hex bolt equals twice the apothem.

What is the difference between the apothem and the circumradius?

The apothem (inradius) is the distance from the centre to the midpoint of a side — it is the radius of the inscribed circle. The circumradius is the distance from the centre to a vertex — it is the radius of the circumscribed circle. For any regular polygon with side length s, apothem a = (s/2)·cot(π/n) and circumradius R = s/(2·sin(π/n)), with R always greater than or equal to a, with equality only at the limit of a circle.

How do interior and exterior angles of a regular polygon relate?

Interior and exterior angles are supplementary at each vertex: θ_int + θ_ext = 180°. For a regular polygon, θ_int = (n−2)·180°/n and θ_ext = 360°/n. As n increases, interior angles approach 180° (a straight line) and exterior angles approach 0°. The sum of all exterior angles of any convex polygon always equals exactly 360°.

Why does a regular hexagon have a circumradius equal to its side length?

For n = 6, R = s/(2·sin(π/6)) = s/(2·0.5) = s. This is because the regular hexagon can be divided into 6 equilateral triangles, each with all sides equal to s. This special property makes hexagonal grids extremely efficient in nature (honeycombs) and engineering (hex packings), since the circumradius exactly equals the side length, simplifying layout calculations.

Can this calculator be used for polygons in real-world unit systems?

Yes — the calculator is unit-agnostic. Enter side length in any consistent linear unit (metres, feet, inches, centimetres) and the perimeter and apothem will be returned in the same unit, while area is returned in that unit squared. Just ensure all inputs use the same unit. For engineering applications, convert units before entering values and apply project-specific tolerances and safety factors to the outputs.

Last updated: 2025-01-15 · Formula verified against primary sources.