I'm trying to create a large circle composed of a variable number of points ( or smaller circles ). I can do this by making each smaller circle individually, but it seems like I should be able to create an array. I want to be able to access each of the smaller circles and make changes to it (color, etc.) without affecting all the smaller circles. Does anyone know how to do this? I'll include the code I've written to create each circle individually and the code I wrote that is much shorter and works, but I don't know how to access each smaller circle individually in this code. Please help!!!
//first code where I create each smaller circle individually
size(1000, 1000);
background(0);
stroke(255,0,0);
noFill();
smooth();
int radius = (400);
float angle = radians (36);
float x = 100 + (cos(angle) * radius);
float y = 100 + (sin(angle) * radius);
ellipse (x + radius, y + radius, 6, 6);
float angle2 = radians (72);
float x2 = 100 + (cos(angle2) * radius);
float y2 = 100 + (sin(angle2) * radius);
ellipse (x2 + radius, y2 + radius, 6, 6);
float angle3 = radians (108);
float x3 = 100 + (cos(angle3) * radius);
float y3 = 100 + (sin(angle3) * radius);
ellipse (x3 + radius, y3 + radius, 6, 6);
float angle4 = radians (144);
float x4 = 100 + (cos(angle4) * radius);
float y4 = 100 + (sin(angle4) * radius);
ellipse (x4 + radius, y4 + radius, 6, 6);
float angle5 = radians (180);
float x5 = 100 + (cos(angle5) * radius);
float y5 = 100 + (sin(angle5) * radius);
ellipse (x5 + radius, y5 + radius, 6, 6);
float angle6 = radians (216);
float x6 = 100 + (cos(angle6) * radius);
float y6 = 100 + (sin(angle6) * radius);
ellipse (x6 + radius, y6 + radius, 6, 6);
float angle7 = radians (252);
float x7 = 100 + (cos(angle7) * radius);
float y7 = 100 + (sin(angle7) * radius);
ellipse (x7 + radius, y7 + radius, 6, 6);
float angle8 = radians (288);
float x8 = 100 + (cos(angle8) * radius);
float y8 = 100 + (sin(angle8) * radius);
ellipse (x8 + radius, y8 + radius, 6, 6);
float angle9 = radians (324);
float x9 = 100 + (cos(angle9) * radius);
float y9 = 100 + (sin(angle9) * radius);
ellipse (x9 + radius, y9 + radius, 6, 6);
float angle10 = radians (360);
float x10 = 100 + (cos(angle10) * radius);
float y10 = 100 + (sin(angle10) * radius);
ellipse (x10 + radius, y10 + radius, 6, 6);
---------------------------------------------------------------
//other code
//I can't access each of the smaller circles individually in this code
//help!!!
size(1000, 1000);
background(0);
stroke(255,0,0);
noFill();
smooth();
int radius = (400);
for (int deg = 0; deg < 360; deg += 36) {
float angle = radians (deg);
float x = 100 + (cos(angle) * radius);
float y = 100 + (sin(angle) * radius);
ellipse (x + radius, y + radius, 6, 6);
}
1