So I've been trying to create polygons with a certain amount of vertices, out of a circle, by calculating the points on this circle and then connect them all. The problem being : Processing won't connect the vertices together.
From the get go, the method I'm using isn't optimal, instead of calculating the points and then placing the vertices on those points, I'm using the rotate() function.
I know that there's a formula using sin() and cos() to calculate the points out of a circle, but I can't remember it.
Anyway, here's the code
translate(width/2,height/2);
ellipse(0,0,250,250);
let numPoints = 3;
beginShape();
for (let i = 0; i < numPoints; i ++){
vertex(-250/2,0);
ellipse(-250/2,0,10);
rotate(TWO_PI/numPoints)
}
endShape();
Thanks for your help !