円を重ねて並べる
Pattern-0200 円を重ねて画面全面に並べてみましょう。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
//=========================================== // 円のパターン 円を並べる //=========================================== // CreationDate: 2025年3月20日 木曜日14:31:18 //=================【環境設定】================ size(400, 400); //画面サイズ //=================【初期設定】================ noFill(); //塗りつぶしなし int div=12; // 円の個数 float r=width/div; //円の半径 float x, y; //円の位置 ellipseMode(RADIUS); //==================メイン==================== for (y=0; y<height; y+=r) { for (x=0; x<width; x+=r) { circle(x, y, r); } } |

Pattern-0201 円を半円にしてみます。今度は円弧を使って描きます。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
//=========================================== // 円のパターン 半円を並べる //=========================================== // CreationDate: 2025年3月20日 木曜日14:48:52 //=================【環境設定】================ size(400, 400); //画面サイズ //=================【初期設定】================ noFill(); //塗りつぶしなし int div=12; // 円の個数 float r=width/div; //円の半径 float x, y; //円の位置 float s=radians(180); float e=radians(360); ellipseMode(RADIUS); //==================メイン==================== for (y=0; y<height; y+=r) { for (x=0; x<width; x+=r) { arc(x, y, r,r,s,e); } } |
Pattern-0202 開始・終了角度や少しの修正で様々なパターンが作成できます。







コメント