0
$\begingroup$

I want to create a regular polygon with a given side length, s, and an maximum radius, r1.

A regular polygon

The radius value needs to be decreased (or increased if it simplifies things) to the closest length, r2, that will create a regular polygon, i.e. with the given side length s, and any integer number of sides, n.

So from s and r1 you need to calculate a new, nearby r2 and the associated n.

Is this possible? It seems like something that should be straight forward, but I'm not sure where to start.

[Edit: changed apothem to radius in the question, as radius would ultimately be more helpful.]

$\endgroup$
1
$\begingroup$

Solution sketch:

The circumradius $r$ of a regular polygon is $$r=\frac{s}{2\sin(\frac{\pi}{n})}$$

Solve for $n$ and calculate the value with the given $r$ and $s$. Remove the fractional part of $n$ (floor). This is your $n$. Then calculate the new $r$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.