Approximating a circle with an irregular polygon

313 Views Asked by At

Please bear with me as I have not done geometry since secondary school and that was a while ago.

  1. I know the lengths of each side $(S)$ of an $ n$-sided polygon $P$. For my current problem these lengths are all 2.

  2. I know the desired inradius $(r)$. (Always an integer or an integer and a half.)

There's also a rough relation between $r$ and $n$. I essentially determine $n$ by $r \times 2 \times \frac{\pi}{2}=\pi r$ and then rounding to the nearest integer. So if $r$ is $9$ I'd go with $28$ sides. For $8.5$ I'd go with $27$, etc.

A small subset of up to about $4$ pre-determined sides ($S_p$) will have their center at $r$ from the midpoint and their edges perpendicular to the imaginary line towards the midpoint. One of the elements of $(S_p)$ will be at a $0^{\circ}$ angle relative to the midpoint (top of the incircle so to say). If $n$ can be divided by $2$ or $4$ then there will be $2$ or $4$ $S_p$ respectively at a multiple of $90^{\circ}$ angle relative to the midpoint (these $S_p$ will be the sides of the polygon numbered ($1,\frac{n}{2}+1$) or ($1, \frac{n}{4}+1, \frac{2n}{4}+1, \frac{3n}{4}+1$) respectively. For other $S_p$ (if any) the angle relative to the midpoint is unknown.

So for instance, for the $28$-sided polygon example above where the length of $S$ is $2$ and $r$ is $9$, the $S_p$'s are $1$, $8$, $15$, and 22 and the center of them would be at $(0, 9)$, $(9, 0)$, $(0, -9)$, and $(-9, 0)$, respectively.

What I would like to figure out are two things:

  1. The ideal inner (or outer, if what I read thus far about polygons is correct they have a straightforward relationship) angles of the remaining sides $S$.
  2. For sides $S_p$ that do not have an angle assigned to them due to the size of $n$, their angle relative to the midpoint.

Let me also acknowledge here that I know this cannot be solved for an arbitrary $n$ or arbitrary $S_p$. Also, if the $S_p$ are too close to each other it cannot work.

Background: I'm fiddling with Lego using Bricklink's Studio software and while you can approximate the angles as discussed in Squaring the Circle: Building Round Shapes Using LEGO, 4) Round Walls Using Hinge Bricks and Plates (essentially $\frac{360}{n}$) this can lead to subtle issues in the software as the Lego hinge plates are not as aligned with the grid as they could be (and would be in real life). I.e., the polygon we are dealing with is not regular.

The idea here is that the $S_p$ positioned at a multiple of $90^{\circ}$ angles are anchored to the grid. The remaining $S_p$, if any, will be anchored to the midpoint (using a turntable in the middle and a plate to cover the radius).

(What is a bit strange to me is that I cannot find an existing solution to this problem. It seems to me that others building Lego would have run into this by now. But perhaps I don't know what to search for, although I tried a fair number of things.)