What this calculator does
This tool works backwards from a known area. Given the area \(S\) of a regular (equilateral and equiangular) polygon and its number of sides \(n\), it returns the length of one side \(a\) and the total perimeter \(L\). It is the inverse of the standard "area from side" formula and is handy for design, tiling, geometry homework, and CAD layout when you know how much surface a shape must cover but need its edge dimensions.
The formula explained
A regular polygon with \(n\) equal sides of length \(a\) has area $$S = \frac{n \cdot a^2}{4 \cdot \tan\!\left(\frac{\pi}{n}\right)}.$$ Solving this for \(a\) gives $$a = \sqrt{\frac{4S \cdot \tan\!\left(\frac{\pi}{n}\right)}{n}},$$ and the perimeter is simply $$L = n \cdot a.$$ The angle \(\frac{\pi}{n}\) is in radians (in code, Math.PI / n). As \(n\) grows, \(\tan\!\left(\frac{\pi}{n}\right)\) approaches \(\frac{\pi}{n}\) and the polygon converges toward a circle of the same area.
How to use it
Enter the area \(S\) in any consistent square units (cm², m², in², or unitless), then enter the number of sides \(n\) (3 for an equilateral triangle, 4 for a square, 5 for a pentagon, and so on). The side \(a\) comes out in the matching linear units; for example, an area in cm² yields a side in cm.
Worked example
Take a square with area \(S = 100\), \(n = 4\). Here \(\tan\!\left(\frac{\pi}{4}\right) = 1\), so $$a = \sqrt{\frac{4 \cdot 100 \cdot 1}{4}} = \sqrt{100} = 10,$$ and \(L = 4 \cdot 10 = 40\). That is exactly a 10 by 10 square with perimeter 40 — confirming the result.
FAQ
Why must \(n\) be at least 3? Fewer than three sides cannot enclose an area, so it is not a polygon. For \(n = 2\) the term \(\tan\!\left(\frac{\pi}{2}\right)\) diverges.
What units do I get? The side and perimeter share the linear units of your area's square units. If \(S\) is in m², \(a\) and \(L\) are in m.
Does this assume a regular polygon? Yes. All sides and angles must be equal. Irregular polygons cannot be solved from area alone.