Geometric recursion
One rule applied to each piece, then to the pieces of the pieces.
The rule
Geometric recursion means applying a rule to a shape, then to each of the pieces it produces, then to the pieces of the pieces. Take the Sierpiński carpet: cut a square into nine, remove the middle one, and start again on the eight that remain. At each step the number of squares is multiplied by eight:
squares = 8^n
Here n is the depth: 1 square at 0, 8 at 1, 64 at 2, then 512, 4,096. The trees follow another rhythm. The Pythagoras tree puts a right triangle on a square, and its two legs carry two new squares. The H-tree draws a segment, then at each end a perpendicular segment, scaled down by a factor of 1/√2. In both cases, each piece gives birth to two:
pieces = 2^(n+1) − 1
The numbers climb fast, hence the toy's limit: the carpet stops at 5 steps, the trees at 6.
Your turn
Pick a shape and turn the depth slider: the piece count shows at each step, so you can check the two formulas above. “Next level” moves up one level, “Play” chains them.
Notice what does not change: the rule. Only the depth varies, and the figure never holds anything but the same idea, repeated smaller and smaller.
Pieces
The drawing above is a teaching sketch, not the artwork: it shows the rule, it does not replay the colours, the size of the dots or the grain of the print.
What changes from one algorithm to the next
All eight apply a rule to its own results. What changes is the starting shape, and what decides when to stop: a fixed depth, or a bounded dose of chance.
- Sierpiński Carpet
- The toy's carpet: a square cut 3 × 3, the central cell removed, and the same again on the other eight down to the chosen depth (4 by default). No random draw: an artwork's variety comes from its settings, colours included.
- H-Tree
- The toy's H-tree. A centred segment, then at each end a perpendicular segment, scaled by an adjustable factor (1/√2 by default, 7 levels). No random draw.
- Fractal Circles
- The carpet's round cousin: the same 3 × 3 cut, but a circle is inscribed in each cell instead of filling it. Repeat it, and the rings nest inside one another.
- Apollonian Gasket
- The Apollonian gasket. A large circle holds two others, and in each curved triangle left over, a new circle is slipped in, tangent to its three neighbours, thanks to Descartes' theorem. It stops when a circle gets smaller than a pixel.
- Pythagoras Tree
- The toy's Pythagoras tree. An angle sets the triangle's lean: at 45° the tree is symmetric, anywhere else it leans to one side. The squares follow the lean of their branch.
- Recursive Shredder
- Here, chance joins the dance. A rectangle is cut at a point drawn within bounds (by default between 30% and 70% of the side), and each piece has a chance of stopping there: fill its rectangle, draw a target or place a disc. It is the only one in the family whose cutting changes from one seed to another.
- Kleinian Pearls
- Kleinian pearls. Two Möbius transformations and their inverses generate a group, and we draw the circles that group carries along. We draw circles, not pixels: a few thousand are enough, which makes an endless zoom affordable.
- Droste
- The Droste effect: an image containing a smaller copy of itself, endlessly. Each pixel is read again in log-polar coordinates, and a pattern that repeats at every turn becomes self-similar automatically. The zoom loops back on itself.
What chance decides
For each artwork, the program draws these settings at random, between bounds set in advance.
- Maximum depth Sierpiński Carpet from 3 to 6
- Reduction ratio H-Tree from 0.62 to 0.75
- Branch lean (°) Pythagoras Tree from 25 to 65
The algorithms in this family
- Sierpiński Carpet
- H-Tree
- Fractal Circles
- Apollonian Gasket
- Pythagoras Tree
- Recursive Shredder
- Kleinian Pearls
- Droste