RosettaCodeData/Task/Archimedean-spiral/Processing/archimedean-spiral-2.processing

19 lines
285 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
float theta;
float rotation;
void setup() {
size(300, 300);
theta = 0;
rotation = 0.1;
background(255);
}
void draw() {
translate(width/2.0, height/2.0);
theta += rotation;
rotate(theta/PI);
point(theta, 0);
// check restart
if (theta>width/2.0) frameCount=-1;
}