6

I am trying to approximate a circle with a regular polygon for a drawing program.

I would like to compute how many sides are needed for a regular polygon to approximate a circle of radius $R$ such that at the point where the regular polygon is furthest from the true circle it is less than some specified tolerance $D$.

enter image description here

It seems like there should be a clear solution to this, but I have no idea where to begin.

Thanks for taking a look at my question!

Bar Smith
  • 229

2 Answers2

4

Considering a circle with radius $R > 0$ and center the origin, if a vertex of a $n$-sided regular polygon inscribed in it is $\left(R,\,0\right)$, the next one in an anticlockwise direction has coordinates $\left(R\,\cos\left(\frac{2\,\pi}{n}\right),\,R\,\sin\left(\frac{2\,\pi}{n}\right)\right)$.

The required distance is equal to the difference between the radius of the circle and the distance of the midpoint between the two vertices considered from the origin:

$$ D = R\left(1 - \cos\left(\frac{\pi}{n}\right)\right) $$

for which, once a tolerance $\delta = \kappa\,R$ with $0 < \kappa \le \frac{1}{2}$ is fixed, we get:

$$ D \le \delta \quad \quad \quad \Leftrightarrow \quad \quad \quad n \ge \frac{\pi}{\arccos\left(1-\kappa\right)} $$

i.e.

$$ n_{min} = \text{ceiling}\left(\frac{\pi}{\arccos\left(1-\kappa\right)}\right). $$

On the other hand, this expression can be simplified with the first term of the Maclaurin series:

$$ n_{min} = \text{ceiling}\left(\frac{\pi}{\sqrt{2\,\kappa}}\right) $$

which at most overestimates by one side compared to the exact one. That's all. ^_^

3

The distance in question is $$D = R\left(1-\cos\left(\frac\pi n\right)\right),$$ as you can check from this answer, for example.

Combining that with $D \le \epsilon$ and doing a bit of algebra, we get $$n \ge \frac\pi{\arccos\left(1-\frac\epsilon R\right)}.$$

Théophile
  • 24,627