ソフトウェア/pukiwiki/p5jsプラグイン の履歴(No.1)
更新LANG: p5js_live const sk = sketch; let n = 6; let t = 0;
sk.setup = () => { sk.createCanvas(400, 400, canvas); sk.frameRate(30); };
sk.draw = () => { sk.textSize(15); sk.background(255); sk.noStroke(); let dx = 360 / (n + 3); let dy = 360 / n; for(let i=0; i<n; i++){ sk.fill(sk.color('hsl('+sk.round(i/(n+1)*360)+', 100%, 50%)')); let y = 10 + i * dy; let k = (i+1)*sk.PI/(n+1); let w = sk.sqrt((1-sk.cos(k))); sk.text('N='+(i+1), 0, y+5); for(let j=0; j<=n+1; j++){ let delta = sk.sin(k*j); delta *= sk.cos(w*t) let x = 40 + (j + 0.3 * delta) * dx; sk.ellipse(x,y,10,10); } } sk.text('j = ', 0, 360); for(let j=0; j<=n+1; j++){ let x = 37 + j * dx; sk.text(j, x, 360); } t += 0.2; }
Counter: 0 (from 2010/06/03),
today: 0,
yesterday: 0