In my math textbook there's a demonstration for the calculus of the circumference of a circle that involves regular polygons inscribed in the circle, but I don't get it. The book gives the following formula: $$l_{2n}=\sqrt{2R^2 - R\sqrt{4R^2-l_{n}^2}}$$ Where $l_{n}$ is the side of a regular n-sided polygon inscribed in a circle with R radius. Then, somehow using that formula, the books tells me that: $$l_{4}=R\sqrt2$$ But how do I reach that number? What was substituted for what?
And what's the use of that formula? Suppose, for example, that a square is inscribed in a circle. I know the radius and want to find the side of the square. How would I apply the formula? It doesn't exist a polygon with 2 sides!
The book then applies the same formula to a polygon with 8 sides, then one with 16, then 32, then 64 and shows the larger the number of sides of a polygon, the closer its perimeter is to the circumference. I can understand that, but I don't understand how it can find a number such as $R\sqrt2$ for the side of square without knowing the side of a hypotetical 2-sided polygon.
I hope I've made my question clear.