Files
sunny9898/task8/wk8/wk8_example2a/wk8_example2a.pde
louiscklaw 5637fbf94f update,
2025-02-01 02:07:58 +08:00

20 lines
410 B
Plaintext

// Based on Listing 4-1, Generative Art
float x, y, radius = 200, centX, centY;
size(500, 500);
background(255);
centX = width / 2;
centY = height / 2;
strokeWeight(5);
stroke(0, 60);
noFill();
ellipse(centX, centY, radius*2, radius*2);
stroke(0);
for (float ang = 0; ang <= 360; ang += 10) {
float rad = radians(ang);
x = centX + (radius * cos(rad));
y = centY + (radius * sin(rad));
point(x, y);
}