A friend of mine asked me how to derive the area and perimeter of a regular $n$-gon with a radius $r$ for a design project he is working on. I came up with this, but I want to make sure I didn't make any errors before giving it to him.
First, I assumed that the $n$-gon was inscribed in a circle of radius r centered at the origin, with the first vertex of the circle being at the point $(r,0)$.
The vertices of the $n$-gon will divide the circle into $n$ equal sections. Because the total angle of a circle is $2\pi$, then the angle between the $x$-axis and the second vertex is $\frac{2\pi}{n}$. Using trigonometry, the coordinates of this vertex are $\left(r\cos\left(\frac{2\pi}{n}\right), r\sin\left(\frac{2\pi}{n}\right)\right)$.
Now, the origin, the first vertex, and the second vertex form a triangle. The edge of this triangle which touches the circle in two places, using the distance formula, will have a length of $r\sqrt{\left(\cos\left(\frac{2\pi}{n}\right)-1\right)^2 + \left(\sin\left(\frac{2\pi}{n}\right)\right)^2}$.
Now, the $n$-gon will be made up of $n$ of these triangles, and so the perimeter is: $nr\sqrt{\left(\cos\left(\frac{2\pi}{n}\right)-1\right)^2 + \left(\sin\left(\frac{2\pi}{n}\right)\right)^2}$.
Now, the triangle has a base of $r$ and a height of $r\sin(\frac{2\pi}{n})$. There area of a triangle is half the product of its base and height, so the area of the triangle is $\frac{r^2\sin\left(\frac{2\pi}{n}\right)}{2}$.
Again, the $n$-gon is made up of $n$ of these triangles, so its area is: $\frac{nr^2\sin\left(\frac{2\pi}{n}\right)}{2}$