35


size(400,200);
noStroke();
smooth();
background(255);
float offset = 100.0;
float scaleVal = 20.0;
float angleInc = PI/18.0;
float angle = 0.0;
for(int x =0; x <= width; x += 5){
float y = offset + (sin(angle)*scaleVal);
fill(155,40);
ellipse(x,y,8,8);
y = offset + (cos(angle) * scaleVal);
fill(0,40);
ellipse(x,y,8,8);

y = offset+(cos(angle) * scaleVal/8);
fill(100,40);
ellipse(x,y,8,8);
angle += angleInc;
}

コメント