Calculates the area of a regular n-gon as n × side² ÷ (4 × tan(180° ÷ n)). Each interior angle is 180° × (n − 2) ÷ n. The polygon needs at least 3 sides.
A regular polygon has equal sides and equal angles; equilateral triangles, squares and regular hexagons are all examples. The number of sides and the side length are enough to pin down the area.
Each interior angle is , and the perimeter is .
With the defaults, and , a regular hexagon. Since ,
The interior angle is and the perimeter is .
Join the centre to every vertex and the polygon splits into congruent isosceles triangles. Each has base and height equal to the apothem, the distance from the centre to a side, which is . Multiplying the area of one triangle by gives the formula above.
The number of sides has to be a whole number of at least 3; decimals and values below 3 are rejected. Do not confuse the interior angle, the angle between two adjacent sides and in the example, with the central angle , which is here.