// String art, Version 0 // Start with a simple setup // to draw lines... float angle; float radius; float cx, cy; float x1, y1, x2, y2; float strokeColor; void setup() { size(500, 500); smooth(); background(255); // Initial settings cx = width/2; cy = height/2; radius = width/2; angle = 0; // degrees strokeColor = 0; } // setup void draw() { angle = angle - 3; float theta = radians(angle); // compute the end points of line x1 = cx + radius * cos(theta); y1 = cy + radius * sin(theta); x2 = cx + radius * cos(theta+PI); y2 = cy + radius * sin(theta+PI); // Draw the line stroke(strokeColor); strokeWeight(1); line(x1, y1, x2, y2); } // draw()