はじめに
L-systemで自己回避曲線(Self-avoiding curves)を描いてみます。平面充填曲線(Space-filling curves)にもなっています。下の図をクリックすると拡大図がご覧になれます。
3角形のなかま
図形 |
初期規則 |
角度 |
変換規則 |
|
xf+f+xf+f+xf+f |
60 |
x=xf+f+xf-f-f-xf-f+f+f-f+f+f-x |
|
x |
60 |
x=fp+fy+fp-fp-fx-fp-fy+fp+fx
y=fy-fp-fx+fp+fy+fp+fp-fx-fp
p=fp
f= |
|
x |
60 |
x=fp+fp-fx-fp+fp+fy+fp+fx-fp-fy+fp-fp-fx-fp-fy+fp+fx-fp-fy+fp+fx
y=fp-fp+fy+fp-fp-fx-fp-fy+fp+fx-fp+fp+fy+fp+fx-fp-fy+fp+fx-fp-fy
p=fp
f=
|
|
y3-f3-w |
30 |
w=+++x--F--zFx+
x=---w++F++yFw-
y=+zFx--F--z+++
z=-yFw++F++y--- |
|
x |
60 |
x=ffffwwpp+fp+fw+fp+fx-fp-fx-fp-fy+fp+fx-fp-fx-fp-fy+fp+fx-fp-fy+fp+fx
y=ffffwwpp-fp-fw-fp-fy+fp+fy+fp+fx-fp-fy+fp+fy+fp+fx-fp-fy+fp+fx-fp-fy
w=fffffffppppwww
p=fp
f= |
|
x |
60 |
x=fpa+fp+fz-fp-fz-fp-fw+fp+fz
y=fpa-fp-fw+fp+fw+fp+fz-fp-fw
z=ffffppppbb+fp+fpb+fp+fx-fp-fx-fp-fy+fp+fx-fp-fx-fp-fy+fp+fx-fp-fy+fp+fx
w=ffffppppbb-fp-fpb-fp-fy+fp+fy+fp+fx-fp-fy+fp+fy+fp+fx-fp-fy+fp+fx-fp-fy
a=ffffffppppppbbb
b=fffpppaa
p=fp
f= |
|
x |
30 |
x=fx+fp+++fy-fp-fy-fp++fp---fx---fp-fy+++fp+fx---fp---fx+fp+++fy+++fp--fp+fx
y=fy-fp---fx+fp+fx+fp--fp+++fy+++fp+fx---fp-fy+++fp+++fy-fp---fx---fp++fp-fy
p=fp
f= |
|
x |
30 |
x=fa+fp+++fb-fp-fb-fp++fp---fa---fp-fb+++fp+fa---fp---fa+fp+++fb+++fp--fp+fa
y=fb-fp---fa+fp+fa+fp--fp+++fb+++fp+fa---fp-fb+++fp+++fb-fp---fa---fp++fp-fb
a=++fy-fp++fp---fx---fp-fy+++fp+fx
b=--fx+fp--fp+++fy+++fp+fx---fp-fy
p=fp
f= |
|
l |
30 |
l=l--f--r++f++l+f+r--
r=++l-f-r--f--l++f++r |
|
l |
30 |
l=l--f--r+f+r+f+l++f++r-f-r---f---r++f++l+f+r--
r=++l-f-r--f--l+++f+++l+f+l--f--r-f-l-f-l++f++r |
|
x+f+y |
45 |
x=x-f-y+f+x+f+y
y=x-f-y-f-x+f+y |
|
y |
30 |
l=++y--f--r++++f++r-f---fl---f-y++f++l+f+++x----f--x+f+l
r=r-f-y++f++++y---f-r--f--x+f+++fr+++f+l--f----l++f++x--
y=--l++f++x----f--x+f+++fy+++f+l--f--y-f---r++++f++r-f-y
x=x+f+l--f----l+++f+x++f++r-f---fx---f-y++f++++y--f--r++ |
|
l |
30 |
l=---fx++++frfx-
r=+fyfl----fy+++
x=+++fl----fyfl+
y=-frfx++++fr--- |
|
l |
30 |
l=---fx+++ff+rfx-
r=+yfl-ff---yf+++
x=+++fl---ff-yfl+
y=-rfx+ff+++rf--- |
|
l |
30 |
l=--fx+++faf+++l--f--xflf
x=fxfl--f--x+++faf+++lf--
a=ff |
4角形のなかま
図形 |
初期規則 |
角度 |
変換規則 |
|
l |
90 |
l=-rf+lfl+fr-
r=+lf-rfr-fl+ |
|
fa |
45 |
a=a-f-fa+f+fa+f+fa+f+fa-f-fa-f-fa-f-fa+f+fa |
|
faf |
45 |
a=af-f-faf+f+faf+f+faf+f+faf-f-faf-f-faf-f-faf+f+fa |
|
fl |
90 |
l=lflf-rf-rf+lf+lf-rf-rflf+rf+lflfrf-lf+rf+lflf+rf-lfrf-rf-lf+lf+rfrf-
r=+lflf-rf-rf+lf+lfrf+lf-rfrf-lf-rf+lfrfrf-lf-rflf+lf+rf-rf-lf+lf+rfrf
f= |
|
fl |
90 |
l=lf-rfr-fl+f+lflfl+frfr-
r=+lflf-rfrfr-f-rf+lfl+fr |
|
r |
90 |
l=lflf-rfr-flfl+frf+lfl+fr-f-rf+lfl+frfrfr-
r=+lflflf-rfr-fl+f+lf-rfr-flf-rfrf+lfl+frfr |
|
-l-f-l-f-l-f-l-f |
45 |
l=l-f-r+f+l-f-r+f+l+f+r-f-l+f+r+f+l-f-r+f+l+f+r+f+l-f-r-f-l-f-r+f+l-f-r-f-l+f+r-f-l-f-r+f+l-f-r+f+l
r=r+f+l-f-r+f+l-f-r-f-l+f+r-f-l-f-r+f+l-f-r-f-l-f-r+f+l+f+r+f+l-f-r+f+l+f+r-f-l+f+r+f+l-f-r+f+l-f-r |
|
fx+fx+fx+fx |
90 |
x=xfyfx+f+yfxfy-f-xfyfx
y=yfxfy-f-xfyfx+f+yfxfy |
|
+x+f+x+f+x+f+x+f |
90 |
x=x+f+x-f-x-f-x-f-x+f+x+f+x+f+x-f-x |
|
fxf++fxf++fxf++fxf |
45 |
x=+yf--fy+
y=-xf++fx- |
|
+fx+f+f+f+fx+f+f+f |
45 |
x=x+f-f-f-f-f+fx+f+f+f+fx+f-f-f-f-f+fx |
|
XF+F+XF+F |
90 |
X=XF-F+F-XF+F+XF-F+F-X |
|
L--F--L--F |
45 |
L=+R-F-R+
R=-L+F+L- |
6角形のなかま
図形 |
初期規則 |
角度 |
変換規則 |
|
fl |
60 |
l=fl+fr++fr-fl--flfl-fr+
r=-fl+frfr++fr+fl--fl-fr
f= |
|
fx |
30 |
x=-f++f-x-f--f+y---f--f+y+f++f-x+++f++f-x-f++f-x+++f--f+y--
y=+f++f-x-f--f+y+f--f+y---f--f+y---f++f-x+++f++f-x+++f--f+y
f= |
|
fl |
60 |
l=flfl+fr--fr-fl-frfr+fl++flfl-frfr--fr-fl+fr+fl++fl-fr+flfl+fr-fl++fl+fr-fl-frfr--fr-fl++fl+fr-
r=+fl-fr--fr+fl++flfl+fr+fl-fr--fr+fl-frfr-fl+fr--fr-fl-fr+fl++flfl+frfr--fr-flfl+fr+fl++fl-frfr
f= |
|
L |
60 |
L=LzfR--fR-f++Lf++L-f+Lf+R--y
R=z++L-fR-f+R--fR--f+Lf++LfyR
z=-
y=+ |
|
fl |
60 |
l=flfl-frfr-fl-frfr--fr-fl++fl+fr+flfl+fr+flflfl+frfr-
r=+flfl-frfrfr-fl-frfr-fl-fr--fr+fl++flfl+fr+flfl+frfr
f= |
ドラゴンカーブのなかま
図形 |
初期規則 |
角度 |
変換規則 |
|
f+fa-f |
45 |
a=a+f+fb
b=a-f-fb |
|
X |
45 |
X=X+F+Y
Y=X-F-Y |
|
fx+f |
60 |
x=x+f+fx-f-fx |
|
x |
60 |
x=x+f+x-f-x |
|
fx+f+fx+f+fx+f |
60 |
x=x+f+fx-f-fx |
|
fl |
60 |
l=rf+lf++lf-rf--rf+lflf++lf+rf-lf+rf--rf-lf-
r=+rf+lf++lf-rf+lf-rf--rfrf-lf++lf+rf--rf-lf
f= |
|
fx+f+fx+f+fx+f |
60 |
x=y-f-fy+f+fy
y=x+f+fx-f-fx |
|
fl |
90 |
l=frfl+fl+fr-fl-
r=+rf+lf-rf-rflf
f= |
|
x+f+x+f+x+f+x+ |
45 |
x=x+f+x+f+x-f-x-f-x |
|