Polar coordinates (r, angle) map to Cartesian (x, y) as x = cx + r*cos(a), y = cy + r*sin(a)
Processing uses Cartesian (x, y) coordinates for all drawing primitives, but many generative forms — circles, arcs, spirals, wave clocks — are naturally expressed in polar coordinates as a radius and an angle. The conversion is: x = centerX + radius * cos(radians(angle)); y = centerY + radius * sin(radians(angle)). The center of the polar coordinate system is (centerX, centerY). Iterating angle from 0 to 360 at any radius traces a circle; varying the radius with angle traces a spiral; placing shapes at polar positions with a fixed radius creates evenly-spaced arrangements. A common error is forgetting the radians() conversion — Processing’s trig functions require radians, not degrees.
Examples
ch4_1_1_Circle.pde iterates ang 0–360 in steps of 5 and plots x = centX + (radius * cos(rad)); y = centY + (radius * sin(rad)). ch4_1_1_Circles.pde uses the same loop to position small circles at each point on a ring.
Assessment
Given just the formula x = cx + rcos(a), y = cy + rsin(a), predict the shape produced when r is fixed and a increments from 0 to 2PI. Then explain what changes if r doubles every 10 degrees.