Finding integer coordinates for a pentagon, hexagon, heptagon, octagon, and nonagon, etc.

1.3k Views Asked by At

Wondering what the formula is for finding integer coordinates for an arbitrary "regular" polygon. By regular I mean symmetrical polygons like pentagon, hexagon, etc.

In particular, I would like to know what integer coordinates are for a:

  • Pentagon
  • Hexagon
  • Heptagon
  • Octagon
  • Nonagon

For instance, the Wikipedia pentagon SVG has these coordinates:

<polygon points="294,3 585.246118,214.602691 474,556.983037 114,556.983037 2.753882,214.602691" fill="white" stroke="black" stroke-width="4"/>

They are complex and unintuitive floating point values. I would instead like to figure out how to find purely integer coordinates, so for a pentagon it would be something like:

<polygon points="10,10 20,20 30,20 20,30 20,10" fill="white" stroke="black" stroke-width="4"/>

That doesn't make a pentagon, but it has all integer coordinates.

In order to accomplish this, it probably requires specifying a viewport or aspect ratio. So maybe it is wxh as 1000x1200, or 901x817 or something. I don't know how to figure this out.

To summarize, wondering what the equation is for figuring out integer coordinates for a symmetrical polygon, specifically those 5 above.

2

There are 2 best solutions below

1
On

Those don't exist, at least not in the 2-dimensional Euclidean plane. I'm 100% sure for all of the given ones except the octagon (EDIT: see at the end why the octagon is also impossible). The reason is that for 3 points $P,Q,R$ to be consecutive vertices of such a regular $n$-gon, the $\angle PQR$ must have size $180°-360°/n$.

The tangens of the inclination $\alpha$ any straight line with equation $y=mx+n$ in a right-angled $(x,y)$-coordinate system has with the $x$-axis has is given by

$$\tan \alpha = m$$

If that line goes trough 2 points with integer coordinates (say $P=(p_x, p_y)$ and $Q=(q_x,q_y)$), we get

$$\tan \alpha_{PG} = m_{PQ}=\frac{q_y-p_y}{q_x-p_x},$$

which implies that $m_{PQ}$ is a rational number.

The same goes for the line through $Q$ and $R$ and it's inclination $\alpha_{QR}$, its tangens is also a rational number.

Now, the $\angle PQR$ we considered before is now just the difference of those two inclinations:

$$\angle PQR = \alpha_{PQ}-\alpha_{QR}$$.

The addition theorem for the tangens-function now says:

$$\tan \angle PQR = \frac{\tan \alpha_{PQ} - \tan \alpha_{QR}}{1+\tan \alpha_{PQ}\tan \alpha_{QR}}$$

The main point is now that if $P,Q,R$ have interger coordinates, this expression for $\tan \angle PQR$ is a rational number, as all the terms are rational and they are combined with elementatary operations that are closed for rationals numbers.

But $\tan 180°-360°/n$ is not a rational number for $n=5,6,7,9$. It is rational for $n=8$, as $180°-360°/8 = 135°$, so this proof does not work here.

I'm not sure what the answer is for $n=8$, could be either way.

ADDITION: It's impossible for the octagon as well. If $P,Q,R$ are the consecutive vertices of the octagon (so $Q$ is the middle one of the three), then $\angle QPR = 22.5°$. But $\tan 22.5°=\sqrt{2}-1$ is irrational, so the same argument as above applies, just for a different angle.

0
On

We can develop a series of approximants for a regular pentagon in $\mathbb {Z}^3$ (the three-dimensional integer lattice) using the familiar "$0-1-\phi$" formula for the vertex coordinates of a regular icosahedron.

According to this formula, the vertices of a properly scaled and positioned regular icosahedron may be rendered as

$(0,\pm1,\pm\phi)$

and cyclic permutations, where the $\pm$ signs are chosen independrntly and $\phi=(1+\sqrt5)/2$. The regular pentagon vertices are then those belonging to any one of the twelve rings into which the edges are grouped. One such ring has the following vertices in rotational order:

$(0,-1,\phi)$

$(\phi,0,1)$

$(1,\phi,0)$

$(-1,\phi,0)$

$(-\phi,0,1)$

These coordinates cannot be scaled up exactly due to $\phi$ being irrational, but we can approximate $\phi$ as tge ratio of two cibsecutive Fibonacci numbers $F_{n+1}/F_n$. Thus we get the approximated regular pentagon in $\mathbb {Z}^3$:

$(0,-F_n,F_{n+1})$

$(F_{n+1},0,F_n)$

$(F_n,F_{n+1},0)$

$(-F_n,F_{n+1},0)$

$(-F_{n+1},0,F_n)$

For example, we may take $n=5,F_n=5,F_{n+1}=8$ and obtain a (slightly nonplanar) pentagon with the following sides and angles (in rotational order starting from the first vertex named above):

Sides: $9.899, 9.899, 10.000, 9.899, 8.899$ (target $=2F_n=10$)

Angles: $107°49',108°26',107°38',107°38',108°38',\Sigma=539°59'$ (Targets $=108°,540°$)