/** Petals.pde Dave Bollinger http://www.davebollinger.com right-click to generate next pattern */ int npetals; float theta, dtheta; float drag; float skale, dskale; float ctrx, ctry; void setup() { size(400,400,JAVA2D); smooth(); ctrx = width / 2f; ctry = height / 2f; next(); } void next() { npetals = (int)random(30,300); skale = random(50,100f); dskale = -skale / (float)(npetals); theta = 0f; dtheta = random(-1f, 1f); drag = random(-1f, 1f); } void draw() { background(255); fill(32,192,96); stroke(0,16); translate(ctrx, ctry); float a = (PI/2f) + drag; float s = skale; float t = theta; for (int i=0; i