Created
July 6, 2018 09:36
-
-
Save iandioch/fa2968b8d24ffe9b88e2cc7d89c31e93 to your computer and use it in GitHub Desktop.
p5js random wee experiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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