/** a lissajous explorer by guru */ float fx = 1; float fy = 1; void setup() { size(300,300,P2D); smooth(); } void draw() { background(0); stroke( 255,50 ); translate( width/2, height/2 ); PVector last = new PVector( 100,0); for( int i = 0; i < 72000; i++) { PVector p = new PVector( cos( radians(i) * fx ) * (100 + i/2000), sin( radians(i) * fy ) * (100 + i/2000) ); line( last.x, last.y, p.x, p.y ); last = p; } } void mousePressed() { fx = map( mouseX, 0, width, 0.1, 1); fy = map( mouseY, 0, width, 0.1, 1); } void mouseDragged() { fx = map( mouseX, 0, width, 0.1, 1); fy = map( mouseY, 0, width, 0.1, 1); }