RosettaCodeData/Task/Archimedean-spiral/Processing/archimedean-spiral-3.processing
2023-07-01 13:44:08 -04:00

19 lines
347 B
Text

PVector pv;
float rotation;
void setup() {
size(300, 300);
rotation = 0.1;
pv = new PVector(rotation, 0);
background(255);
}
void draw() {
translate(width/2.0, height/2.0);
pv.setMag(pv.mag()+rotation);
println(pv.mag());
pv.rotate(rotation/PI);
point(pv.x, pv.y);
// check restart
if (pv.mag()>width/2.0) frameCount=-1;
}