4

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!

user7413
  • 143
  • 3

1 Answers1

3

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.

ratchet freak
  • 5,950
  • 16
  • 28