4
$\begingroup$

How can I find the vertices of a polygon (specifically hexagon) given the radius of the incircle? I want to calculate the vertices of a polygon given the face-to-face distance (inscribed circle diameter?)

I've below code to calculate the vertices from the Circum-circle of a polygon

(x,y) - Center of the circumcircle

r - Radius of the circumcircle

for (var i = 1; i <= sides; i++)
{
    var X = x + r * Math.Cos(2 * Math.PI * i / sides);
    var Y = y + r * Math.Sin(2 * Math.PI * i / sides);

    vertices.Add(new Tuple(X,Y));
}

Alternatively, what is the relation between radius of the in-circle and circum-circle of a polygon? Could you please share a relevant resource or a code snippet (any language is fine).

Thanks!

$\endgroup$

1 Answer 1

3
$\begingroup$

what is the relation between radius of the in-circle and circum-circle of a polygon?

That is $cos ( \frac{2\pi}{n}*\frac{1}{2} ) = cos ( \frac{\pi}{n})$

The triangle with edges from the center to the middle of a side, from the center to an adjacent corner and half the side connecting them is a right angle triangle. The angle of the point at the center $ =\frac\pi 2$.

Then it's simply the cosine to get the ratio between adjacent and hypotenuse.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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