// Exercise 061 - Curve // Conchoid of Nicomedes // Paul Bartlett float x,y; float r, theta; float a; float b = 50; float res = 500.0; void setup(){ size(640,480); smooth(); strokeWeight(0.4); } void draw(){ background(255,255,102); fill(80); rect(0,300,width,300); a = 55*pow(sin(0.0005*millis()),3); //a = 55*sin(0.001*millis()); for(int t=0; t<2.0*PI*res; t++){ r = b+a/cos(t/res); x = r*sin(t/res); y = -r*cos(t/res); if (y+300>300){ stroke(255,255,102); } else{ stroke(80); } point(x+width/2,y+300); } }