13



 float angle = 0.0;
 float speed = 0.01;
 float radius = 130.0;
 float sx = -2.214;
 float sy = -3.45;

void setup(){
 size(400,400);
 noStroke();
 smooth();
}

void draw(){
 fill(30,20,230,2);
 rect(0,0,width,height);
 angle += speed;
 float sinVal = sin(angle);
 float cosVal = cos(angle);

 float x = width/2 + (cosVal * radius);
 float y = height/2 + (sinVal * radius);


 float x2 = x + cos(angle * sx)*radius/2;
 float y2 = y + sin(angle * sy)*radius/2;
 fill(255);
 ellipse(x2,y2,7,7);
}

コメント