What is an isogonal polygon?
An isogonal polygon here is a polygon with 2n sides whose sides alternate between two lengths a and b and whose interior angles are all equal. All its corners lie on one circle, and every corner looks the same: a turn by 360°/n or a mirror maps any corner onto any other. With n = 2 it is the rectangle a × b; with a equal to b it is the regular polygon with 2n sides.
This calculator finds the area, the perimeter, the radius of the circle through the corners, the distances from the centre to a side of length a and to a side of length b, and the interior angle.
How to use it
Enter the two side lengths a and b and the number n of sides of each length (n from 2 to 1,000, a whole number; the polygon then has 2n sides). The page refuses a side that is 0 or negative and an n that is not a whole number in that range. Every measure is solved from the values you enter. The length unit is a label only: lengths are shown in that unit and areas in its square. The page shows results rounded to at most 6 decimal places and writes values from 10¹² up as a 12-digit number times a power of ten, such as 1.23456789012 × 10¹², and very small values out in full.
Derivation of the formulas
Put the corners on a circle of radius R around the centre. A side of length a seen from the centre spans the angle α, a side of length b the angle β, and the n pairs of sides go once around: n(α + β) = 2π. With θ = π/n this says α/2 + β/2 = θ. The half-chords give a = 2R sin(α/2) and b = 2R sin(β/2) = 2R sin(θ − α/2); expanding the sine of the difference,
$$b = 2R\cos\tfrac{\alpha}{2}\,\sin\theta - a\cos\theta \quad\Longrightarrow\quad 2R\cos\tfrac{\alpha}{2} = \frac{b + a\cos\theta}{\sin\theta}$$R cos(α/2) is the distance from the centre to a side a. Adding the squares of 2R sin(α/2) = a and of the line above eliminates the angle α:
$$R = \frac{\sqrt{a^2 + b^2 + 2ab\cos\theta} }{2\sin\theta}, \qquad h_a = \frac{b + a\cos\theta}{2\sin\theta}, \qquad h_b = \frac{a + b\cos\theta}{2\sin\theta}, \qquad \theta = \frac{\pi}{n}$$The lines from the centre to the corners cut the polygon into n triangles on the sides a (height h_a) and n on the sides b (height h_b), so
$$A = \frac{n}{2}\left(a h_a + b h_b\right) = \frac{n\left(2ab + (a^2 + b^2)\cos\theta\right)}{4\sin\theta}, \qquad P = n(a + b)$$Each interior angle is 180° − (α + β)/2 = 180° · (n − 1)/n, the same at every corner. For n = 2 (θ a right angle) the formulas give the rectangle: A = ab, R = √(a² + b²)/2, h_a = b/2. For a = b they give the regular polygon with 2n sides of length a. The formulas were also checked another way: solving the corner angles on the circle numerically, placing the corners and measuring the area with the shoelace formula gives the same values.
Worked example
With the defaults a = 3, b = 5 and n = 3 (a hexagon whose sides alternate 3 and 5, every angle 120°) the area is about 40.703194 square units, the perimeter is 24, the circumradius is about 4.041452, and the distances from the centre to the sides are about 3.752777 (to a side 3) and 3.175426 (to a side 5).
FAQ
Which inputs are refused?
A side a or b that is 0 or negative or outside 0.000001 to 1,000,000,000, an n that is not a whole number from 2 to 1,000, and text that is not a number. Every pair of positive sides gives a polygon, so no other combination is refused.
Why are all the angles equal?
All corners lie on one circle and the sides alternate, so the two sides at every corner are one a and one b; the angle between them is the same at every corner, 180° · (n − 1)/n.
Why does n stop at 1,000?
It is a product limit of this page: with 2,000 sides the polygon is already indistinguishable from its circle in a drawing.
Does the unit change the numbers?
No. Geometry does not depend on the unit, so the unit only labels the results.
How accurate are the results?
Each value is rounded once to the digits shown, a value exactly halfway being rounded up, from a calculation carried well beyond those digits: 80 significant digits (π to 90 digits, the sine and cosine of π/n as series, square roots to that precision); the perimeter and the angle are exact, and so are the area and the distances to the sides for n = 2. When a value lies very close to the halfway point between two shown values, the page recalculates with 160 and then 320 digits, and a value that can come out exact (such as the circumradius for n = 2 or 3 when its square is the square of a fraction) is decided exactly if 320 digits still cannot tell its side. A value typed with hundreds of digits can still lie closer to a halfway point than that, and its last shown digit may then be off by one.
Accuracy and input range
Each value is rounded once to the digits shown, a value exactly halfway being rounded up, from a calculation carried well beyond those digits: 80 significant digits (π to 90 digits, the sine and cosine of π/n as series, square roots to that precision); the perimeter and the angle are exact, and so are the area and the distances to the sides for n = 2. When a value lies very close to the halfway point between two shown values, the page recalculates with 160 and then 320 digits, and a value that can come out exact (such as the circumradius for n = 2 or 3 when its square is the square of a fraction) is decided exactly if 320 digits still cannot tell its side. A value typed with hundreds of digits can still lie closer to a halfway point than that, and its last shown digit may then be off by one.
Enter each length from 0.000001 to 1,000,000,000 and n as a whole number from 2 to 1,000. Anything outside is refused with a message naming the range.
References
D. Zwillinger (ed.), CRC Standard Mathematical Tables and Formulae, 33rd ed., CRC Press, 2018, ch. 4 (polygons: chords and areas of polygons inscribed in a circle)