# How do I get an integer from a polygon equation, which usually returns fractions?

Known: edge length

Unknown: number of edges

Radius should increase of decrease to an interval to ensure number of edges in Polygon is divisible by 1

E.g. edge length is 100mm, number of edges unknown, radius is 6m. How do I find the closest radius to 6m which gives an integer, divisible by 1, for a realistic number of edges.

Previous Question

If a regular polygon has a fixed edge length, can I know how many edges it has by knowing the length from corner to its center?

the radius of the polygon, and it has the formula $$r=\frac{s}{2\sin\left(\frac{180°}{n}\right)}$$ where $$s$$ is the side length of the polygon and $$n$$ is the number of sides. So given $$r$$ and $$s$$, you can simply solve the above equation for $$n$$.

Asterix

It's worth pointing out that when you solve for n there's no guarantee that it will turn out to be an integer, and hence correspond to a regular polygon

I have no math background, not even enough to know which tags to attach. How do I solve for these intervals of radii?

• Can you clarify more about your question. What you want and what is your target to achieve?
– KMN
Apr 10, 2022 at 3:37
• @user1042110 done. Planning to implement solution in CAD program Apr 10, 2022 at 7:09

Rearrange your formula for $$r$$ in terms of $$n$$
$$n = \frac \pi {\arcsin\left( \frac s {2r} \right)} \approx \frac {2 \pi r} s \quad \text{for } r \gg s$$
and insert the desired values. For your example $$n \approx 2 \pi \frac{6 \text{ m}}{0.1 \text{ m}} \approx 377$$ is very close
$$\begin{array}{c|c|c|c} n & 376 & 377 & 378 \\ \hline r \text{ in m} & 5.9843 & 6.0002 & 6.0161 \end{array}$$