Here's a parametric equation I have made for a regular $n$-gon, coded in R:
n=5; theta=(0:999)/1000; r=cos(pi/n)/cos(2*pi*(n*theta)%%1/n-pi/n); plot(r*cos(2*pi*theta),r*sin(2*pi*theta),asp=1,xlab="X",ylab="Y", main=paste("Regular ",n,"-gon",sep="")); And picture:

The formula I used is
$$\displaystyle r=\frac{\cos\left(\frac{\pi}{n}\right)}{\cos\left(\left(\theta \mod \frac{2\pi}{n}\right) -\frac{\pi}{n}\right)} \; .$$
This equation is actually just the polar equation for the line through the point $(1,0)$ and $(\cos(2\pi/n),\sin(2\pi/n))$ which contains one of the edges. By restricting the range of the variable $\theta$ to the interval $[0,2\pi/n]$$[0,2\pi/n[$, you will in fact just get that edge. Now, we want to replicate that edge by rotating it repeatedly through an angle $2\pi/n$ to get the full polygon. But this can also be achieved by using the modulus function and reducing all angles to the interval $[0,2\pi/n]$$[0,2\pi/n[$. This way, you get the polar equation I propose.
So, using polar plots and the modulo function, it's pretty easy to make regular $n$-gons.