float x1,y1,x2,y2;
float div = 16000;
float mult = 3.2e2;
float x,y,diax,diay;
float tmax = random(2,8);
void setup() {
size(800,600);
background(255);
rectMode(CENTER);
x1 = random(10,15);
y1 = random(10,15);
x2 = random(30,60);
y2 = random(40,60);
}
void draw() {
stroke(0);
strokeWeight(0.3);
sinloop(frameCount);
}
void sinloop(float i){
calc(i);
pushMatrix();
translate(width/2.2 + (mult*x),height/2 + (mult*y));
for(int t=1;t<tmax;t++){
rotate(PI/8*t);
ellipse(0,0, (2*mult*diax),(1*mult*diay));
}
popMatrix();
}
void calc(float i){
x = 2*cos(x1*PI*i/div)*(1 - 3*pow(sin((x2+frameCount/1000)*PI*i/div),4)/4);
y = sin(y1*PI*i/div)*(1 - 3*pow(cos((y2-frameCount/150)*PI*i/div),2)/4);
diax = abs(0.035 + pow((sin(54*PI*i/div)),3)/5);
diay = abs(0.035 + pow((cos(24*PI*i/div)),3)/7);
}