beginfig(1)
u := 1cm;
pair t;
t = dir (60);
pair a[];
pair b[];
a0 = (0, 0);
b0 = (u, 0);
for i=1 upto 6:
pair c[];
pair d[];
c0 = a[i-1];
d0 = b[i-1];
for j=1 upto 5:
c[j] = c[j-1] + d[j-1];
draw c[j-1]--c[j];
d[j] = (xpart t * xpart d[j-1] - ypart t * ypart d[j-1],
xpart t * ypart d[j-1] + ypart t * xpart d[j-1]);
endfor;
a[i] = a[i-1] + b[i-1];
b[i] = (xpart t * xpart b[i-1] + ypart t * ypart b[i-1],
xpart t * ypart b[i-1] - ypart t * xpart b[i-1]);
endfor;
dotlabel.lrt("0", 1/2[a0, a3]+(-5, 5));
endfig;
每次画五条边,共六次,组成七个六边形。算是一个小型蜂窝了。
图形: