R/createCircle.R

createCircle <-
function(center, r, n=40, begin=0, end=2*pi)
{
theta  = seq(begin, end, (end - begin)/n)
x <- cos(theta) * r + center[1]
y <- sin(theta) * r + center[2]

cbind(x,y)
}

Try the PlotRegionHighlighter package in your browser

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

PlotRegionHighlighter documentation built on May 2, 2019, 9:34 a.m.