Contenu connexe
Similaire à Processing資料(5) 正弦波と極座標 (12)
Processing資料(5) 正弦波と極座標
- 3. float theta;
void setup() {
size(580, 350);
background(255);
}
void draw() {
background(255);
for (int i = 0; i < 30; i++) {
ellipse(i*20, height/2 + 100*sin(radians(theta + i * 10)), 20, 20);
}
theta++;
}
- 4. float theta;
void setup() {
size(580, 350);
background(255);
}
void draw() {
background(255);
for (int i = 0; i < 30; i++) {
ellipse(i*20, height/2 + 100*sin(radians(theta + i * 10)), 20, 20);
}
theta++;
}
- 5. float theta;
void setup() {
size(580, 350);
background(255);
}
void draw() {
background(255);
for (int i = 0; i < 30; i++) {
ellipse(i*20, height/2 + 50*sin(radians(theta + i * 10)), 20, 20);
}
theta++;
}
- 7. float theta;
void setup() {
size(580, 350);
background(255);
}
void draw() {
background(255);
for (int i = 0; i < 30; i++) {
ellipse(i*20, height/2 + 100*sin(radians(theta + i * 10)), 20, 20);
}
theta++;
}
- 8. float theta;
void setup() {
size(580, 350);
background(255);
}
void draw() {
background(255);
for (int i = 0; i < 30; i++) {
ellipse(i*20, height/2 + 100*sin(radians(theta + i * 30)), 20, 20);
}
theta++;
}
- 12. int r = 150;
float x;
float y;
int theta;
void setup() {
size(400, 400);
background(255);
}
void draw() {
fill(255, 30);
noStroke();
rect(0, 0, width, height);
x = width/2 + r * cos(radians(theta));
y = height/2 + r * sin(radians(theta));
fill(0);
ellipse(x, y, 30, 30);
theta++;
}