produce coordinates for a randomly positioned circle in a square plane

rancirc(side_plane = 64, npts = 100, max_radius = NULL)

Arguments

side_plane

numeric(1) length of side

npts

numeric(1) number of points to plot in discrete plane

max_radius

numeric(1) defaults to NULL, must be less than side_plane

Examples

set.seed(1234)
myjpc = array(1, dim=c(30,64,64,3)) # store images with 0 for dark
for (i in seq_len(30)) { 
   z = rancirc() 
   p = load_jpeg(z$x, z$y, siz=sample(c(20,40,60),size=1)) 
   myjpc[i,,,] = p 
   }
plot(0,0,type="n",xlim=c(1,64), ylim=c(1,64))
set.seed(1234)
for (i in seq_len(30)) { lines(rancirc()); sample(c(20,40,60), size=1) }

#z = load_jpeg(rc$x, rc$y, siz=333, dim=c(400,400,3))
#graphics::rasterImage(z, 0, 0, 1, 1, interpolate=FALSE)