Radius of the circumscribed circle of a regular polygon I was going to ask this on SO but I think its more math than programming:
Given the sidelength, number of vertices and vertex angle in the polygon, how can I calculate the radius of its circumscribed circle. 
The polygon may have any number of sides greater than or equal to 3.
The wikipedia entry only discusses circumscribed circle of a triangle...
Thanks!
edit: 
Also, the polygon is centered around the point (0,0). So I guess I'm asking what is the distance from the origin to any of its points..
 A: Each corner of a polygon must be at equal distance from the center of the circumscribing circle.
So, find equation for perpendicular bisectors of any to sides of the polygon.
Intersection of perpendicular bisectors will give you the center of the circle.
Then distance between center and any corner of the polygon is the radius of the circle.
EDIT(response to edited question):
If length of a side is $L$ and number of vertices is $N$ then
Suppose points A and B defines a side and C is the center.
Then angle ACB is $360/N$ 
Suppose D is midpoint of a edge AB then angle DCA = angle DCB = 180/ N.
This implies $sin(180/N) = L/(2R) $ where R is radius of the circle.
So, $ R = \frac{L}{2sin(180/N)}$
Pseudocode:
def get_circumradius(L,N):
    return L/(2 * math.sin(180/N))

A: Let $s$ be sidelength and $\alpha$ be vertex angle. Then using simple trigonometry you can find that
$$
\sin{\frac{\alpha}{2}} = \frac{s/2}{r}
$$
Hence
$$
r = \frac{s}{2 \sin{\frac{\alpha}{2}}}
$$
A: The circumscribed radius $R$ of any regular polygon having $n$ no. of sides each of the length $a$ is given by the generalized formula  $$\bbox[4pt, border: 1px solid blue;]{\color{red}{R=\frac{a}{2}\csc \frac{\pi}{n}} }$$ and its each interior angle is $\color{blue}{\frac{(n-2)\pi}{n}}$.
