Sierpinski Arrowhead

Draw a straight line. Replace it with three lines half as long, turning 60 degrees between them, so they start and end where the old line did. Now replace each of those three the same way, bending each one to the opposite side from the one before.1

Press Line only at level 7 and the line has the holes of the Sierpinski triangle, even though that triangle comes from removing the middle of every triangle and this line comes from bending. Triangles shows what is left of it at each level. Lines and Small triangles always match, because each line is one side of one triangle.

Go to level 4 and drag Draw. The pen draws one side, which ends on a corner of the next triangle, so it goes on from there and passes through every triangle once without lifting.

To go up a level, divide each triangle into four and remove the middle one, which leaves three. The triangle's line bends inward and becomes three lines, one side of each new triangle, and because the triangles lie on alternate sides of the pen, the bends alternate.

In every drawing, each triangle has one corner the pen doesn't touch. The white dot is one of these corners, shared by two triangles: at level 4, Draw 13 puts the pen at the first of them and Draw 67 at the second. In both, it draws the side across from the dot, so the line stays one small triangle's height away. Going up a level halves the triangles, so Line to dot halves too.

No drawing ever touches itself, but if you repeat forever that distance shrinks to zero, so the finished curve passes through the dot twice: one sixth of the way along and again five sixths of the way along.2 The same is true of every corner where two triangles touch and the pen doesn't cross.

Further exploring

Videos

Reading

Sources and notes

  1. The Algorithmic Beauty of Plants, chapter 1, Figure 1.10b on p. 11.
  2. Calculation: the pen reaches a triangle's untouched corner halfway through that triangle, because the corner stays untouched in the middle one of its three smaller triangles, level after level. At level 2, the dot is the untouched corner of the first triangle and the last. Halfway through those is one sixth and five sixths of the way along.