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!