Fractal Tree

AI authored to showcase ironpad capabilities.

Fractal Tree 🌳

A fractal tree is a self-similar structure generated by repeatedly applying a simple branching rule: each branch splits into two smaller branches at a fixed angle, and each new branch is a fixed ratio shorter than its parent.

Self-Similarity

The tree is self-similar at every scale — zoom into any subtree and it looks like the whole tree. This is the hallmark of a fractal. Formally, the tree is the fixed point of the iterated function system (IFS):

T = \bigcup_{i=1}^{2} f_i(T)

where each f_i is a contracting similarity (rotation + scaling).

Recursive Structure

The depth-n tree satisfies:

\text{Tree}(n, \ell, \theta) = \text{branch}(\ell) \cup \text{Tree}\!\left(n{-}1,\, r\ell,\, \theta - \alpha\right) \cup \text{Tree}\!\left(n{-}1,\, r\ell,\, \theta + \alpha\right)

where r \in (0, 1) is the length ratio, \alpha is the branch angle, and recursion bottoms out at n = 0 or \ell < 1.

Connection to L-Systems

Fractal trees are the canonical example of an L-system (Lindenmayer system). The grammar

F \to F[{+}F][{-}F]

produces exactly this branching pattern when turtle-interpreted: move forward, save state, turn left and recurse, restore state, turn right and recurse.

This Notebook

Use the sliders in the next cell to sculpt your tree in real time. Adjust the branch angle, recursion depth, length ratio, and even apply a wind offset to lean the canopy.

Tree Controls
Fractal Tree