Connecting lines to dots
in
Programming Questions
•
1 year ago
I am having trouble connecting lines from one dot to another in this circle. I'm pretty sure I need to loop through an array, but I am not 100% sure how to structure this.
Current code:
float radius = 200;
void setup () {
size(500,500);
background(100);
smooth();
noStroke();
noLoop();
}
void draw () {
background(100);
for (int deg = 0; deg <= 360; deg += 15) {
float angle = radians(deg);
float x = 250+(cos(angle)*radius);
float y = 250+(sin(angle)*radius);
stroke(0);
line(x,y,y,x);
noStroke();
ellipse(x,y,5,5);
}
}
Thanks!
1