Our user asked us to create calculator which should determine "side length of the regular polygon (pentagon, hexagon) by diameter or radius of circumscribed circle".
Actually, this is quite simple. All we have to do is to find length of base of the triangle, which is formed by center of polygon and two adjusted vertexes of the regular polygon. Since two remained sides of the triange are the two radii, and angle by center is 360 divided by number of sides of the regular polygon, we can use law of sines - two sides related to each other as sines of opposite angles. Our triange is also isosceles, so finding the remained angles is piece of cake. Result can be seen below.
P.S. Now I've been asked how to find side length of the regular polygon by radius of inscribed circle?
This is even simplier. Our triange is formed by center of the polygon, one of the vertexes and point of contact between circle and polygon side. Point of contact has right angle, so half of the polygon side is radius multiplied by tangent of sharp angle. Sharp angle is 360 divided by number of sides and divided by 2. Result can be seen below.