Is there an equation to describe regular polygons?

For example, the square can be described with the equation |x|+|y|=1. So is there a general equation that can describe a regular polygon (in the 2D Cartesian plane?), given the number of sides required?

Using the Wolfram Alpha site, this input gave an almost-square:
PolarPlot(0.75 + ArcSin(Sin(2x+Pi/2))/(Sin(2x+Pi/2)*(Pi/4))) (x from 0 to 2Pi)

This input gave an almost-octagon:
PolarPlot(0.75 + ArcSin(Sin(4x+Pi/2))/(Sin(4x+Pi/2)*Pi^2)) (x from 0 to 2Pi)

The idea is that as the number of sides in a regular polygon goes to infinity, the regular polygon approaches a circle. Since a circle can be described by an equation, can a regular polygon be described by one too? For our purposes, this is a regular convex polygon (triangle, square, pentagon, hexagon and so on).

It can be assumed that the centre of the regular polygon is at the origin (0,0), and the radius is 1 unit.

If there’s no such equation, can the non-existence be proven? If there are equations, but only for certain polygons (for example, only for n<7 or something), can those equations be provided?


Any polygon (regular or not) can be described by an equation involving only absolute values and polynomials. Here is a small explanation of how to do that.

Let's say that a curve C is given by the equation f if we have C={(x,y)R2,f(x,y)=0}.

  • If C1 and C2 are given by f1 and f2 respectively, then C1C2 is given by f1.f2 and C1C2 is given by f21+f22 (or |f1|+|f2|). So if C1 and C2 can be described by an equation involving absolute values and polynomials, then so do C1C2 and C1C2.

  • If C={(x,y)R2,f(x,y)0}, then C is given by the equation |f|f.

Now, any segment S can be described as S={(x,y)R2,ax+by=c,x0xx1,y0yy1}, which is given by a single equation by the above principles. And since union of segments also are given by an equation, you get the result.

EDIT : For the specific case of the octagon of radius r, if you denote s=sin(π/8), c=cos(π/8), then one segment is given by |y|rs and x=rc, for which an equation is


So I think the octagon is given by

f(|x|,|y|) f(|y|,|x|) f(|x|+|y|2,|x||y|2)=0

To get a general formula for a regular polygon of radius r with n sides, denote cn=cos(π/n), sn=sin(π/n) and


then your polygon is given by


Depending on n, you can use symmetries to lower the degree a bit (as was done with n=8).

Source : Link , Question Author : Vincent Tan , Answer Author : Joel Cohen

Leave a Comment