Skip to content

Instantly share code, notes, and snippets.

@iandioch
Created July 6, 2018 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandioch/fa2968b8d24ffe9b88e2cc7d89c31e93 to your computer and use it in GitHub Desktop.
Save iandioch/fa2968b8d24ffe9b88e2cc7d89c31e93 to your computer and use it in GitHub Desktop.
p5js random wee experiment
var fcount = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
noStroke();
smooth();
for (var j = 0; j < 5; ++j) {
var numCircle = (j+1)*2;
var d = 15 + j*25;
for (var i = 0; i < numCircle; ++i) {
var a = (i/numCircle)*TWO_PI + fcount/((j+1)*30.0);
var s = 10 + j*2;
ellipse(width/2 + d*cos(a), height/2 + d*sin(a), s, s);
}
}
fcount += 4;
if (fcount == 1800) {
fcount = 10;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment