

ラテン語でfolium、英語でleaf、葉っぱの事ですね。
ケプラーの葉とも呼ばれる葉っぱの様な曲線です。
aの値で様々な形が現れます。
r=(sin(th)2-a)*cos(th)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 240 240 %%Title:foliumカーブを描く /a .25 def % パラメータ /en 400 def % 図形の拡大 0 0 240 240 rectfill % 黒背景 120 120 translate % 図形を中央に移動 newpath % パスの初期化 0 1 360 { % 0から始めて360まで1づつ増分し{ }内を繰り返す /th exch def % 制御変数をth(角度)に入れる % foliumカーブの数式 /r th sin 2 exp a sub th cos mul en mul def /x r th cos mul def /y r th sin mul def % thが0なら始点を置き、さもなくば線を引く th 0 eq { x y moveto } { x y lineto } ifelse } for closepath % 線を繋ぐ 1 1 1 setrgbcolor % 白色 2 setlinewidth % 線幅2ポイント stroke % 線を描画 |
aの値を変えています。図形によって大きさがまちまちなのでen(図形の拡大)で調整しています。

コメント