Sierpiński Arrowhead

See Wikipedia.

The Sierpiński arrowhead curve is a fractal curve similar in appearance and identical in limit to the Sierpiński triangle. Evolution of Sierpiński arrowhead curve The Sierpiński arrowhead curve draws an equilateral triangle with triangular holes at equal intervals. It can be described with two substituting production rules: (A → B-A-B) and (B → A+B+A). A and B recur and at the bottom do the same thing — draw a line. Plus and minus (+ and -) mean turn 60 degrees either left or right. The terminating point of the Sierpiński arrowhead curve is always the same provided you recur an even number of times and you halve the length of the line at each recursion. If you recur to an odd depth (order is odd) then you end up turned 60 degrees, at a different point in the triangle. An alternate constriction is given in the article on the de Rham curve: one uses the same technique as the de Rham curves, but instead of using a binary (base-2) expansion, one uses a ternary (base-3) expansion.

This is the first line fractal I created using the production rules above. I learned that:

  • The angle must be globally administrated.
  • The current point of drawing must be globally administered.

Then the starting point must be set and the two simple recursive procedures were implemented.