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

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

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

Page 1: Processing資料(5) 正弦波と極座標

正弦波と極座標

Processing資料(5)

Page 2: Processing資料(5) 正弦波と極座標

正弦波

Page 3: Processing資料(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 + 100*sin(radians(theta + i * 10)), 20, 20); }

theta++;}

Page 4: Processing資料(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 + 100*sin(radians(theta + i * 10)), 20, 20); }

theta++;}

Page 5: Processing資料(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++;}

Page 6: Processing資料(5) 正弦波と極座標
Page 7: Processing資料(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 + 100*sin(radians(theta + i * 10)), 20, 20); }

theta++;}

Page 8: Processing資料(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 + 100*sin(radians(theta + i * 30)), 20, 20); }

theta++;}

Page 9: Processing資料(5) 正弦波と極座標
Page 10: Processing資料(5) 正弦波と極座標

極座標

θ

r

(r*cos(θ),r*sin(θ))

Page 11: Processing資料(5) 正弦波と極座標

円運動

Page 12: Processing資料(5) 正弦波と極座標

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++;}