H&K #1 360/numsides is an int division. Change to 360.0/numsidesand in the for loop numsides-1 (otherwise you are drawing the first line twice