Successfully reported this slideshow.
Upcoming SlideShare
×

# Processing資料(5) 正弦波と極座標

1,991 views

Published on

Processingについての授業の資料です。

Published in: Technology
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### Processing資料(5) 正弦波と極座標

1. 1. 正弦波と極座標 Processing資料(5)
2. 2. 正弦波
3. 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. 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. 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++; }
6. 6. 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++; }
7. 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 * 30)), 20, 20); } theta++; }
8. 8. 極座標 θ r (r*cos(θ),r*sin(θ))
9. 9. 円運動
10. 10. 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++; }