xxxxxxxxxx
float t;
float x1(float t){
return sin(t/10)*200 + sin(t/6)*300;
}
float y1(float t) {
return cos(t/10)*100;
}
float x2(float t){
return sin(t/10)*200 + sin(t)*2;
}
float y2(float t) {
return cos(t/20)*200 + cos(t/12)*20;
}
static final int NUM_LINES = 20;
static final int NUM_LINES2 = 20;
void setup(){
size(screenWidth, screenHeight);
}
void draw(){
background(255);
stroke(255);
strokeWeight(5);
translate(width/2, height/2);
stroke(255, 0, 0);
for (int i = 0; i < NUM_LINES; i++){
line(x1(-t+i*2), y1(-t+i*2),x2(-t+i), y2(-t+i));
}
stroke(0);
for (int i = 0; i < NUM_LINES2; i++){
line(x1(t+i), y1(t+i),x2(t+i), y2(t+i));
}
t += 0.2;
}