Can there be a single equation for more than one equilateral polygon with the origin set at zero?

Solution 1:

If you want a regular polygon (same sidelengths), for example

  • a square, you can take the following implicit equation:

$$|x \cos(a)+y \sin(a)|+|x \cos(2a)+y \sin(2a)|=b \ \ \text{with} \ \ \text{for any} \ \ a,b,c>0 \tag{1}$$

(the figure below has been drawn with $a:=\pi/2, b=2.7, c=0$ giving the classical $|x|+|y|=b$)

enter image description here

  • a hexagon, you can take:

$$|x \cos(a+c)+y \sin(a+c)|+|x \cos(2a+c)+y \sin(2a+c)|+|x \cos(3a+c)+y \sin(3a+c)|=b \ \ \text{with} \ \ a:=\pi/3$$

enter image description here

These examples are part of the general case for a $2n$-sided polygon:

$$f(x,y)=\sum_{p=1}^n \ |x \cos(pa+c)+y \sin(pa+c)|=b$$

where

  • $a:=\frac{\pi}{n}$,

  • $b$ is an enlargment constant and

  • $c$ is an angular value giving the rotation angle of the figure around the origin.

There is maybe a similar general equation for regular polygons with an odd number of sides, but I haven't found it till now.

(Figures done with Geogebra)

Edit: If one drops the second absolute values in (1)

$$f(x,y)=|x \cos(a+c)+y \sin(a+c)|+x \cos(2a+c)+y \sin(2a+c)=b$$

one gets a quarter plane that can take all positions.

Remark: in fact all this can be established, see for example here due to the fact that the sum of distances from an interior point of a regular polygon to its sides is a constant (precisely the ratio of the area of the polygon divided by its sidelength).

See as well this reference.