R/waves02.R

"waves02" <-
function (num=20, lwd=2, color=grep("^gray", colors(), value=TRUE), 
	seed=NULL) 
{
	if(length(seed)) set.seed(seed)

	canvas()
	for(i in 1:num) for(j in 1:num) {
		ran <- runif(2)
		x <- seq(ran[1], ran[2], length=100)
		lines(x -.5 + i/num, .5 * atan(x) + j/num,
			col=safesample(color), lwd=safesample(lwd))
	}
}

Try the TaoTeProgramming package in your browser

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

TaoTeProgramming documentation built on May 1, 2019, 6:47 p.m.