In my previous post, I created sets of regular polygons in GeoGebra by setting a parameter of the polygons equal to a constant. In this post, I will show the mathematics for determining the side length given a particular parameter.
The values I calculated were side length, radius length, apothem length, area, height, and width. Side length is trivial.
For this post, I will be using the following variables:
- n: Number of sides
- s: Length of side
- r: Length of radius (distance from center to a vertex)
- a: Length of apothem (distance from center to a side)
- A: Area
- h: Height (when one side of the polygon has a slope of 0)
- w: Width (when one side of the polygon has a slope of 0)
Radius, apothem, and area
Every regular polygon can be subdivided into isosceles triangles with a vertex at the center of the polygon. I’ll demonstrate with a heptagon:
Each of these triangles can be further divided into two right triangles. The hypotenuse of these triangles is the radius of the polygon; the legs are the apothem and half the side:
Hence we can use this triangle to move between A, r, a, and s.
Since the polygon can be divided into 2n polygons, and since there are 2π radians in a circle, \(\alpha = \frac{\pi}{n}\). So:
- \(\sin{\alpha} = \frac{s}{2r} \Rightarrow s = 2r\sin{\frac{\pi}{n}}\)
- \(\tan{\alpha} = \frac{s}{2a} \Rightarrow s = 2a\tan{\frac{\pi}{n}}\)
The area of each of the (in this case 14) right trianglea is \(\frac{A}{2n}\) and is equal to \(\frac{s\times a}{2\times2}=\frac{sa}{4}\), so \(A = \frac{nsa}{2}\).
\(\tan{\alpha} = \frac{s}{2a} \Rightarrow a = \frac{s}{2\tan{\alpha}} \Rightarrow A = \frac{ns^2}{4\tan{\alpha}}\) and hence \(s^2 = \frac{4A\tan{\alpha}}{n}\). Therefore:
- \(A = \frac{nsa}{2} \Rightarrow s = 2\sqrt{\frac{A}{n}\tan{\frac{\pi}{n}}}\)
Height
If a polygon has an even number of sides, its height is equal to twice its apothem. Since we already know how to correlate the side length to the apothem, this is a straightforward adjustment:
- \(s = 2a\tan{\frac{\pi}{n}} \Rightarrow s = h\tan{\frac{\pi}{n}} \)
For a polygon with an odd number of sides, we need to consider the hypotenuse of each right triangle; the total height is a + r.
If we want to relate side length to height, consider a right triangle with legs of h and s/2. Let \(\gamma\) be the angle opposite s/2.
Since \(\gamma\) is an inscribed angle on circumcenter of the polygon, \(\gamma = \frac{\alpha}{2} = \frac{\pi}{2n}\).
From here we can relate s and h: \(\tan{\gamma} = \frac{s}{2h} \Rightarrow s = 2h\tan{\frac{\pi}{2n}}\)
Overall, this gives us:
- If n is even: \(s = h\tan{\frac{\pi}{n}} \)
- If n is odd: \(s = 2h\tan{\frac{\pi}{2n}}\)
Width
If the number of sides of the polygon is a multiple of four (doubly even), then its width is equal to its height (i.e., twice the apothem). If the number of sides of the polygon is even but not a multiple of four (singly even), then its width will be twice its radius. This is another straightforward calculation:
- \(s = 2r\sin{\frac{\pi}{n}} \Rightarrow s = w\sin{\frac{\pi}{n}} \)
If the number of sides of the polygon is odd, the width is the length of the longest diagonal.
In the case of the heptagon in the example, this width is CG. However, CG = EA, which we can readily calculate using the triangle from the previous step. We’re now dealing with the hypotenuse instead of the height, so:
- \(\sin{\gamma} = \frac{s}{2w} \Rightarrow s = 2w\sin{\frac{\pi}{2n}}\)
In summary, this gives us:
- If n is doubly even: \(s = w\tan{\frac{\pi}{n}} \)
- If n is singly even: \(s = w\sin{\frac{\pi}{n}} \)
- If n is odd: \(s = 2w\sin{\frac{\pi}{2n}}\)
Width and Height
When deciding on parameters for a polygon, I wondered about the size of the bounding box, that is, the smallest square that can contain the polygon. In the case of regular polygons, the relevant question is whether the width can ever be less than the height.
The radius is always greater than the apothem (being the hypotenuse and a leg, respectively, of a right angle). For polygons with an even number of sides, the width is either equal to twice the apothem (so is equal to the height) or twice the radius (so is greater than the height).
The width and height of a polygon with an odd number of sides are the hypotenuse and a leg of a right angle (thanks to Versylfa Xlevrata for noticing this). Thus the width is always greater than the height.
So using a bounding box would be redundant on using the width.
Summary
Here are all of the equations relating s to one other parameter:
- \(s = 2r\sin{\frac{\pi}{n}}\)
- \(s = 2a\tan{\frac{\pi}{n}}\)
- \(s = 2\sqrt{\frac{A}{n}\tan{\frac{\pi}{n}}}\)
- If n is even: \(s = h\tan{\frac{\pi}{n}} \)
- If n is odd: \(s = 2h\tan{\frac{\pi}{2n}}\)
- If n is doubly even: \(s = w\tan{\frac{\pi}{n}} \)
- If n is singly even: \(s = w\sin{\frac{\pi}{n}} \)
- If n is odd: \(s = 2w\sin{\frac{\pi}{2n}}\)
Nice formulas to calculate the side of the polygon. Very helpful. Thanks.