

フェルマー螺旋の数式は下記ですが、
x=a*sqr(th)*cos(th)
y=a*sqr(th)*sin(th)
パラメータがあまりないので、いじりようがないかもしれません。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 240 240 %%Title:Felmat spiral(フェルマー螺旋)を描く /a 1 def % 大きさ /sw 0 def % 始点を置くためのスイッチ 0 0 240 240 rectfill % 黒塗りつぶし背景 120 120 translate % 座標の原点を中央に移動 newpath % パスの初期化 0 1 12000 { % 0から始めて1づつ増分し12000まで{ }内を繰り返す /th exch def % 制御変数をth(角度)に入れる % フェルマー螺旋の数式 /x a th sqrt mul th cos mul def /y a th sqrt mul th sin mul def % swが0なら始点を置き、さもなくば線を引く sw 0 eq { x y moveto /sw 1 def }{ x y lineto } ifelse } for .5 .7 .8 sethsbcolor % 色設定 stroke % 線を描画する |
コメント