// Started as this: https://www.khanacademy.org/computer-programming/crazy-cosmic-flower/6565370573619200
// MouseX adjusts direction and speed, click to toggle circle/spiral.
// map, spiral, bezier, triangle, line, ellipse, rotate, scale
float incr;
boolean spiral;
void setup() {
size(600, 610);
strokeWeight(.5);
spiral = true;
}
void draw() {
background(0);
triangle(295, 0, 305, 0, 300, 15);
pushMatrix();
translate(width/2, height/2);
for (int i = 0; i < 65; i++) {//82
if (i%2 == 0) fill(0);
else fill(#FCFAC4);
bezier(200, 34, 300, 141, 63, 10, 49, 91);
fill(#03FFFD);
ellipse(200, 200, 8, 8);
fill(#03FFFD, 220);
triangle(100, 88, 100, 100, 193, 174);
stroke(#03FFFD);
line(173, 75, 200, 200);
rotate((incr));
if (spiral) scale(1, 0.99);
}
incr += map(mouseX, 0, width, -.005, .005);
popMatrix();
};
void mousePressed() {
spiral = !spiral;
}