int n = 5; float[] xArray = new float[n]; //allocate memory for 5 points float[] yArray = new float[n]; void setup(){ float angle = 2 * PI / n; //divide the circle in n sections for(int i =0; i< n; i++){ //create points along a circle xArray[i] = 50. + 30. * sin(angle*i); yArray[i] = 50. + 30. * cos(angle*i); } } void draw (){ beginShape(POLYGON); for(int i = 0; i < n; i++) vertex(xArray[i],yArray[i]); endShape(CLOSE); }