# tracciamento di poligoni regolari
x1 <- -1; x2 <- 1; y1 <- -1; y2 <- 1
plot(c(x1,x2),c(y1,y2),type="n",xlab="", ylab="", asp=1)
axis(1,pos=0,label=FALSE,col="brown"); axis(2,pos=0,label=FALSE,col="brown")
n <- 5; x <- y <- vector(length=n)
for (i in 1:n) {x[i] <- cos(2*pi/n*i); y[i] <- sin(2*pi/n*i)}
polygon(x,y,border="green4")
n <- 6; x <- y <- vector(length=n)
for (i in 1:n) {x[i] <- cos(2*pi/n*i); y[i] <- sin(2*pi/n*i)}
polygon(x,y,border="blue")
n <- 7; x <- y <- vector(length=n)
for (i in 1:n) {x[i] <- cos(2*pi/n*i); y[i] <- sin(2*pi/n*i)}
polygon(x,y,border="red")