/* * Star implementation from Greenberg, Xu, Kumar text. */ void setup() { size(600, 600); translate(width/2, height/2); background(0); float radOut = 0.44 * height; float radIn = 0.5 * radOut; star(8, radIn, radOut); } void draw() { } void star(int pointCount, float innerRadius, float outerRadius) { float theta = 0.0; // point count is 1/2 of total vertex count int vertCount = pointCount*2; float thetaRot = TWO_PI/vertCount; float tempRadius = 0.0; float x = 0.0, y = 0.0; beginShape(); for (int i=0; i