R/circle.R

Defines functions circle

Documented in circle

circle <- function(x = 0, y = 0, r = 1, theta = c(0, 360), n = 100, ...){
  a <- seq(theta[1], theta[2], length = n)
  xx <- x + r*cos(a*2*pi/360)
  yy <- y + r*sin(a*2*pi/360)
  	if(!identical(theta, c(0, 360))){
  	  xx <- c(xx, x)
  	  yy <- c(yy, y)
  	}
  	polygon(xx, yy, ...)
}

Try the seqinr package in your browser

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

seqinr documentation built on April 6, 2023, 1:10 a.m.