Find center point of regular polygon

Hi all,
I’ve written a script to generate an N sided regular polygon shape consisting of cubes.However I want to position the shape so that the camera is at its center point.
I was thinking that if I found a point that is the radius of the shape distant from the camera position along an angle of 360- interior angle/2 as the starting point of the shape generation that would work.
So for a 4 sided shape, the interior angle is 90 degrees between sides. So half that is 45degrees. So if i started generation at a point the radius distant from the camera position along the direction of -45 degrees that would ensure the camera is central.
I know how to find the radius and angle. But I cant seem to get the position right:

Quaternion theAngle = Quaternion.Euler(0, -angle/2, 0);

Vector3 tdirection = theAngle * Vector3.forward;

initPosition += tdirection * tunnelRadius;

initPosition is the position of the camera. Any ideas? Thanks.

Regardless of my questions in the comment above, one way how you can find the center of a regular polygon is by simply take the arithmetic mean of all corners. So simply add up all corner positions and divide by the count.

edit

Something like that:

Transform[] cubes;

Vector3 FindCenter()
{
    Vector3 pos = Vector3.zero;
    foreach(Transform t in cubes)
    {
        pos += t.position;
    }
    return pos / cubes.Length;
}