float ini_theta = 0;
float ini_omega = 0.02;
void setup() {
size(800, 800);
}
void draw() {
background(70);
guruguru(350, 400, 200, ini_theta, ini_omega, 50, 20);
ini_theta += ini_omega;
}
void guruguru( int cent_x, int cent_y, int r, float theta, float omega, int ellipse_size, int flag) {
if (flag==0) return;
else {
flag += -1;
}
// previous ellipse
float pos_x = sin(theta)*r;
float pos_y = cos(theta)*r;
//drawing
fill(255, 255, 255, 20);
ellipse(cent_x, cent_y, r*2, r*2);
fill(255);
noStroke();
ellipse(cent_x, cent_y, ellipse_size, ellipse_size);
stroke(255);
line(cent_x,cent_y,pos_x+cent_x,pos_y+cent_y);
// next ellipse
cent_x += pos_x;
cent_y += pos_y;
theta += theta+omega;
guruguru(cent_x, cent_y, r/2, theta, omega*2, ellipse_size/2, flag);
}