Formula: Regular Polygon Mathematical Identity
- sidesN: Sides N (numeric parameter)
- sideLengthS: Side Length S (numeric parameter)
Solve any regular n-gon (pentagon, hexagon, octagon, etc.) from side count and side length.
Because it is a count of line segments, not a measurement. The hexagon always has 9 diagonals and the octagon always has 20, whatever the side length. Changing the side from 10 to 4 changes every length and area on the panel, but the diagonal count stays the same, since it depends only on the number of corners.
The solver refuses it and shows a message asking for a whole number of sides, 3 or more. A shape with 6.5 sides does not exist, so there is no area or angle to report. Enter the whole number for the shape you mean, such as 6 for a hexagon or 8 for an octagon.
The panel shows it directly, but you can check it with the right triangle formed by half a side, the apothem and the circumradius. Square half the side, add the square of the apothem and take the square root. For the default hexagon, 5 squared plus 8.66 squared is about 100, so the circumradius is 10, equal to the side.
They add up to a straight angle at every corner. The hexagon shows 120 degrees inside and 60 outside. The octagon shows 135 and 45. The triangle shows 60 inside and 120 outside. Every regular polygon's exterior angles add up to one full turn, so the Exterior Angle line times the number of sides always gives a full rotation.
Area depends on two lengths multiplied together, the perimeter and the apothem, and both double when the side doubles. Two times two is four. Going the other way, halving the hexagon's side from 10 to 5 drops the area from 259.808 to 64.952, one quarter. Perimeter and apothem only halve.
No. Every formula here assumes all sides are equal and all angles are equal. For a shape with different side lengths, the apothem is not even defined, because the sides sit at different distances from the centre. Split an irregular shape into triangles and add their areas, or use coordinates and a different method. The perimeter is the only figure that still makes sense: add the sides.
Every corner of a triangle is already joined to both other corners by a side, so there is nothing left to draw. The formula agrees: with n = 3, n - 3 is zero, so the count is zero. A square is the first shape with any diagonals, and it has two.
It is the length of one straight edge, corner to corner. Many tile listings quote the width across the flat sides instead, which is twice the apothem. To convert, divide that flat-to-flat width by about 1.732. Entering the flat width as the side length will make the area about three times too large.
It gets very close but never quite matches. As n grows, the circle inside the polygon and the circle through its corners draw together, and the polygon area is squeezed between them. With a fixed perimeter, each extra side adds less area than the one before.
Three, since a polygon needs at least three corners. Entering 2, or any number below three, brings up a message asking for a whole number of sides of 3 or more. The triangle with sides of 10 is one of the comparison rows, with area 43.301, 0 diagonals and a circumradius of 5.774.
A regular hexagon is made of six equilateral triangles meeting at the centre, so its side length equals its circumradius. With sides of 10, every corner is 10 from the centre, the apothem is 10 times half the square root of 3, which is 8.66, and the interior angle is twice 60 degrees, giving the 120 on the panel. Few other polygons have such tidy relationships.
Six sides of length 10 make up the starting shape, a regular hexagon. The panel reports an area of 259.808 square units, a perimeter of 60, an apothem of 8.66, an interior angle of 120 degrees, an exterior angle of 60 degrees, 9 diagonals and a circumradius of 10.
You can rebuild that area from the formula on the page. The apothem is the distance from the centre straight out to the middle of a side. For a hexagon it is s / (2 tan 30°). Tan 30° is about 0.5774, so the apothem is 10 / 1.1547, which is 8.660. The area is then n × s × apothem / 2, or 6 × 10 × 8.66 / 2, which is 60 × 8.66 / 2. That gives the 259.808 on the panel.
Another way to see it: the perimeter times the apothem, halved. A regular polygon is a ring of identical triangles meeting at the centre. Each has the side as its base and the apothem as its height. Add them up and you get half the perimeter times the apothem.
The hexagon is a handy shape to check against because it splits into six equilateral triangles. Each one has sides of 10, so the distance from the centre to any corner is also 10. That corner distance is the circumradius, and the panel's Circumradius line confirms it at exactly 10.
Each corner of an n-sided polygon can connect to n - 1 other corners. Two of those connections are the sides next to it, which are not diagonals, so each corner sends out n - 3 diagonals. Multiplying by n counts every diagonal twice, once from each end, so the total is n(n - 3) / 2.
For the hexagon that is 6 × 3 / 2 = 9, matching the panel. A square gives 4 × 1 / 2 = 2. A pentagon gives 5. An octagon gives 20. A nonagon gives 27, and the solver agrees on all of these. A triangle gives 0, which is right: every pair of corners is already joined by a side.
The count grows roughly with the square of n. Doubling the sides from 6 to 12 takes the diagonals from 9 to 54, six times as many. That is why drawing all the diagonals of a large polygon by hand quickly becomes a mess.
The count is shown as a plain number, 9 for the hexagon, with no unit. That is correct: it is a count of line segments, not a length or an area, so it does not change when you change the side length.
Diagonals come up in less obvious places too. If every person at a round table of n people shakes hands with everyone except their two neighbours, the number of handshakes is the diagonal count. Ten people gives 35. The same idea counts the bracing struts needed to join every non-adjacent corner of a frame, which is why fully braced shapes with many sides get heavy quickly.
The interior angle is the angle inside the shape at each corner. For the hexagon it is 120 degrees. For a square it is 90, for an equilateral triangle 60 and for an octagon 135 degrees. As n increases the corners flatten out and the interior angle creeps toward a straight angle without reaching it.
The exterior angle is the turn you make at each corner when walking around the outside. It is a straight angle minus the interior angle, so 60 degrees for the hexagon and 45 for the octagon. Walking all the way round, those turns add up to exactly one full rotation, whatever the number of sides. That is the quickest way to check the Exterior Angle line: multiply it by n and you should always get a full turn.
The triangle is the case that surprises people. Its interior angle is only 60 degrees, so its exterior angle is the larger of the two, 120 degrees. The panel shows exactly that. From the square onward, the interior angle is always the bigger one.
A seven-sided shape is a useful test of rounding. The solver reports its interior angle as a long decimal because seven does not divide a full turn evenly. If you are cutting wood or setting a mitre saw for a heptagon, that decimal is the honest answer, and you will need to round to whatever your tool can hold.
Side length and area do not move together in step. Perimeter and apothem grow in direct proportion to the side, but area grows with its square. Halve the hexagon's side to 5 and the perimeter halves to 30, the apothem halves to 4.33, and the area drops to a quarter at 64.952.
That square relationship is the source of many estimating mistakes. A paving slab, a gazebo floor or a tabletop that is twice as wide in every direction needs four times the material, not twice. If you are pricing anything by area, run the calculator rather than scaling the old figure by eye.
For the same side length, more sides means more area. With sides of 10, the triangle encloses 43.301, the square 100, the hexagon 259.808 and the octagon 482.843. The perimeter is growing too, which accounts for much of that rise.
If you are fixing the perimeter instead, as with a length of fence or edging, more sides still helps, but by less. A smaller pentagon with sides of 5 has a perimeter of 25 and an area of 43.012. Holding the perimeter constant and adding sides pushes the area toward that of a circle.
A polygon cannot have 3.6 sides or 6.5 sides, and a two-sided shape does not exist. The field help asks for n of at least 3, and the solver enforces it. Enter 6.5 or 2 and it shows a message asking for a whole number of sides, 3 or more, instead of a result.
Side length has a similar rule. A side of zero or less returns a message saying the side must be greater than zero. A polygon with no length has no area to compute.
If you are working from a description rather than a count, name the shape first. A pentagon is 5, a hexagon 6, a heptagon 7, an octagon 8, a nonagon 9, a decagon 10 and a dodecagon 12. Mixing up heptagon and hexagon is a common slip, and the solver cannot catch it because both are valid entries.
The three comparison rows are a useful set to learn from: a triangle, the default hexagon and an octagon, all with sides of 10. Reading across them shows the area, apothem and circumradius growing as corners are added while the side stays the same.
The apothem is the radius of the largest circle that fits inside the polygon, touching the middle of every side. The circumradius is the radius of the circle that passes through every corner. The panel shows both, as Apothem Inradius and Circumradius (Centre to Vertex).
The two are linked by Pythagoras. Half a side, the apothem and the circumradius form a right triangle. For the hexagon, half a side is 5 and the apothem is 8.66, so the circumradius is the square root of 25 + 75, which is 10. For the octagon with sides of 10, the apothem is 12.071 and the circumradius 13.066.
This is the practical figure for marking out a shape. To draw a regular octagon on a board, set a compass to the circumradius, draw a circle, then step round it placing corners. To cut an octagonal table that fits inside a square frame, the apothem is what you need instead: twice the apothem is the distance across the flats.
For an octagon with sides of 4 the solver gives an apothem of 4.828 and a circumradius of 5.226. The width across the flats is twice the apothem, 9.656, and across the corners twice the circumradius, 10.452. That difference is worth knowing before you order a frame or a piece of glass.
The side length box has no unit attached. Whatever you type, the perimeter and apothem come out in the same unit and the area in that unit squared. Enter centimetres and you get square centimetres. There is no conversion step.
Measure one edge from corner to corner along the side, not from the centre and not across the shape. Someone measuring a hexagonal tile across its flat sides is measuring twice the apothem, not the side. For a hexagon, the side is that width divided by the square root of 3, which is about 1.732.
If the object is only roughly regular, like a hand-built planter, measure several sides and average them. The formulas assume every side and every angle is identical, so any real shape will differ from the result a little. For a tile pattern or a machined part the match should be close. For a garden bed it is a good estimate, not a survey.
When you are buying material, work out the area first and then add an allowance for offcuts. Apart from triangles, squares and hexagons, regular polygons cannot cover a floor without gaps, and cutting them from rectangular sheets leaves waste. The calculator gives the finished area only. It knows nothing about the waste left when an octagon is cut from a square board.