float t;
float st;
float u;
void setup() {
size(800,800);
noStroke();
fill(0);
t = 0.0;
frameRate(60);
st = 1;
u = 0.0;
}
void draw() {
t += st * 0.02;
u += 0.02;
if (t > 3) {
st = -1;
t = 3;
} else if (t < 0) {
st = 1;
t = 0;
}
background(255);
for (float i = 0; i < 2 * PI; i += 0.01) {
float r = cos(3 * i / 2 + u) * cos(3 * i / 2 + u) * width * 1.0 / 9 * t;
float x = width * 1.0 / 35 * (10 - t) * cos(i) + width * 1.0 / 2;
float y = width * 1.0 / 35 * (10 - t) * sin(i) + height * 1.0 / 2;
ellipse(x, y, r, r);
}
}