57 lines
1.3 KiB
Text
57 lines
1.3 KiB
Text
float theta;
|
|
float x, y, d = 0.01;
|
|
|
|
void setup(){
|
|
size(600,600);
|
|
theta = 0;
|
|
noStroke();
|
|
}
|
|
|
|
void draw(){
|
|
translate(300,300);
|
|
rotate(-PI/2);
|
|
x = cos(theta);
|
|
y = sin(theta);
|
|
if(theta < 0.01){
|
|
d = 0.01;
|
|
}else if(theta > 2*PI - 0.01){
|
|
d = -0.01;
|
|
}
|
|
theta += d;
|
|
background(0);
|
|
fill(0xFF*4/4);
|
|
arc(0,0,480,480,0,theta);
|
|
|
|
fill(0xFF*3/4);
|
|
if(theta < PI){
|
|
arc(0,0,400,400,0,(PI*1/2-(x+pow(x,3)/6)));
|
|
}else{
|
|
arc(0,0,400,400,0,(PI*3/2+(x+pow(x,3)/6)));
|
|
}
|
|
fill(0xFF*2/4);
|
|
if(x>0&&y>0&&((y+pow(y,3)/6) < PI*1/4)){
|
|
arc(0,0,320,320,0,(y+pow(y,3)/6));
|
|
}else if(y>0&&((PI*1/2-x*1.11) < PI*3/4)){
|
|
arc(0,0,320,320,0,(PI*1/2-(x+pow(x,3)/6)));
|
|
}else if(x<0&&((PI*2/2-y*1.11) < PI*5/4)){
|
|
arc(0,0,320,320,0,(PI*2/2-y*1.11));
|
|
}else if(y<0&&((PI*3/2+x*1.11) < PI*7/4)){
|
|
arc(0,0,320,320,0,(PI*3/2+x*1.11));
|
|
}else{
|
|
arc(0,0,320,320,0,(PI*4/2+y*1.11));
|
|
}
|
|
|
|
fill(0xFF*1/4);
|
|
if(x>0&&y>0&&((y*1.11) < PI*1/4)){
|
|
arc(0,0,240,240,0,(y*1.11));
|
|
}else if(y>0&&((PI*1/2-x*1.11) < PI*3/4)){
|
|
arc(0,0,240,240,0,(PI*1/2-x*1.11));
|
|
}else if(x<0&&((PI*2/2-y*1.11) < PI*5/4)){
|
|
arc(0,0,240,240,0,(PI*2/2-y*1.11));
|
|
}else if(y<0&&((PI*3/2+x*1.11) < PI*7/4)){
|
|
arc(0,0,240,240,0,(PI*3/2+x*1.11));
|
|
}else{
|
|
arc(0,0,240,240,0,(PI*4/2+y*1.11));
|
|
}
|
|
|
|
}
|