n <- 40
nn <- 2
thetas <- seq(0, nn * 2 * pi, length=n)
rhos <- seq(1, n) / n
plot(c(-1, 1), c(-1, 1), type="n")
abline(h=0, col="grey")
abline(v=0, col="grey")
xy <- polar2xy(rhos, thetas)
points(xy$x, xy$y, col=rainbow(n))
Run the code above in your browser using DataLab