/* * Simple "graphing calculator" to sketch the parametric curve: * x = t * cos(t) * y = t * sin(t) * albeit, recentered in the middle of the canvas */ void setup() { size(600, 400); noFill(); background(255); beginShape(); for (float t=0; t < width; t += 0.01) { float x = 0.5*width + t * cos(t); float y = 0.5*height + t * sin(t); vertex(x, y); } endShape(); save("spiral.png"); }