R/circles.R

Defines functions circles

Documented in circles

circles <-
function(x0,y0,r,n=100, cols, ...){
  theta <- seq(0, 2 * pi, length=n)
  x=matrix(rep(x0, each=n), nrow=n)
  y=matrix(rep(y0, each=n), nrow=n)
  x <- x + r * cos(theta)
  y <- y + r * sin(theta)
  for(i in 1:length(x0)) polygon(x[,i], y[,i], col=cols[i], ...)
  return(list(x,y))
}

Try the pathview package in your browser

Any scripts or data that you put into this service are public.

pathview documentation built on May 2, 2019, 4:56 p.m.