home/ atoms/ spiral-as-growing-radius

An Archimedean spiral is drawn by incrementing both angle and radius simultaneously in a loop

A spiral is the polar-coordinate shape where radius grows as angle increases. In Processing, the loop condition tracks radius (not angle); radius increments each iteration while angle increments by a fixed step (or a noise-perturbed step). Each new (x, y) polar position is connected to the previous one with line(), building the spiral stroke. The visual density of the spiral’s coils is controlled by the ratio of the radius increment to the angle step: a large angle step and small radius increment produces tightly-wound coils; reversing this gives an open, fanning form. The exploratory Spiral3–Spiral6 variants animate this ratio in the draw() loop, morphing the spiral in real time.

Examples

ch4_1_2_Spiral.pde: for(float ang = 0; radius <=width/3; ang +=10){ radius +=0.5; float rad = radians(ang); x = centX + (radius * cos(rad)); ... line(x,y,lastx,lasty); }. Spiral3 animates step (the angle increment) growing each frame via step += stepIncrement.

Assessment

Predict what the spiral looks like if the radius increment is much larger than the angle increment. Then modify ch4_1_2_Spiral.pde to produce a tighter spiral with five times as many coils before stopping.

“for(float ang = 0; radius <=width/3; ang +=10){ radius +=0.5; float rad = radians(ang);”
corpus · generative-art-code-examples-josephfiola-genart-processing-p · chunk 36