generative art 円

円を描く. 眠いのでちょっと休憩する.

f:id:ksumiya0318:20160929040501p:plain

size(500, 300);
background(255);
strokeWeight(5);
smooth();

float centx = width/2;
float centy = height/2;
float radius = height/2 - 10;

stroke(0, 30);
noFill();
ellipse(centx, centy, 2*radius, 2*radius);

stroke(0);
float angmin =   0;
float angmax = 360;;
float x, y;

for (float ang = angmin; ang <= angmax; ang += 5) {
  float rad = radians(ang);
  x = centx + radius*cos(rad);
  y = centy + radius*sin(rad);
  
  point(x, y);
}

眠い...