xxxxxxxxxx
int n = 500; //線的數量
float delta;
float factor;
void setup(){
size(800,650);
delta = 2*PI/n; //旋轉角度
frameRate(5); //幀數
}
void draw(){
//factor = 32*mouseX/width;
factor = 7; //可以調整數字
background(50);
translate(width/2, height/2);
stroke(30,30,290); //橢圓形顏色
strokeWeight(6); //線的粗細
noFill();
ellipse(0,0,800,400); //外圍橢圓形
stroke(100,280,0); //線的顏色
strokeWeight(5); //點的粗細
for(int i = 0; i < n; i ++){
point(400*cos(i*delta), 300*sin(i*delta));
strokeWeight(1); //線的粗細
line(400*cos(i*delta), 300*sin(i*delta), 400*cos(factor*i*delta), 300*sin(factor*i*delta)); //可以調整數字
}
}