Fractals - Self-Similarity in Nature
Iterating a small set of rules produces structures that recur in ferns, coral, electrical discharge, lung airways, and river networks. Each figure renders its construction step by step, with colour mapped to a quantitative variable - recursion depth, height, or arrival time. The generating principles are summarised below, followed by the elementary constructions and then the four generators.
A fractal is a set whose structure is approximately self-similar across scales: a magnified region resembles the whole. Such geometry is common in biological and physical systems, where iterated or recursive processes generate large surface area, transport reach, or drainage within a bounded region from a compact rule. The figures on this page are each produced by one of four mechanisms:
1. Iterated function systems (the chaos game)
Fix a finite set of contraction maps \(w_i(\mathbf{x})=A_i\mathbf{x}+\mathbf{b}_i\). From an arbitrary starting point, iterate by applying a map chosen at random at each step; the orbit converges to a unique attractor, which is the fractal. The Barnsley fern uses four such maps.
2. Recursive branching (L-systems)
A production rule replaces each symbol with a scaled arrangement of copies and is applied repeatedly: a segment yields two shorter segments, each of which branches again. The same recursive substitution describes branching in trees, bronchi, and neurons.
3. Growth processes (aggregation)
Particles undergo random walks and adhere on contact with a growing cluster. This diffusion-limited aggregation yields branched, self-screening morphologies observed in coral, lichen, frost, and electrical discharge.
4. Escape-time iteration
Iterate \(z_{n+1}=z_n^{2}+c\) in the complex plane. Some initial values remain bounded and others diverge; the boundary separating these outcomes is fractal - the Julia and Mandelbrot sets.
Self-similarity, formally: fractal dimension
If a shape is built from \(N\) copies of itself each scaled down by a factor \(s\), its similarity dimension is
A line has \(N=2,\ s=\tfrac12\Rightarrow D=1\); a square \(N=4,\ s=\tfrac12\Rightarrow D=2\). Fractals fall between the integers - they are rougher than a curve but do not fill an area:
| Shape | Copies / scale | Dimension \(D\) |
|---|---|---|
| Cantor set | 2 copies, scale 1/3 | 0.631 |
| Koch curve | 4 copies, scale 1/3 | 1.262 |
| Sierpinski triangle | 3 copies, scale 1/2 | 1.585 |
| Diffusion-limited aggregate | statistical | ≈ 1.71 |
| Barnsley fern | statistical | ≈ 1.8 |
Tip: the button (bottom-right) toggles a high-contrast theme; every animation honours your reduced-motion setting and will render the finished figure without motion.
Elementary constructions
Each construction below applies a single operation repeatedly to a line segment or a triangle. Advance one level at a time to observe the successive refinement and its associated dimension.
Cantor set
D = log2/log3 ≈ 0.631
Remove the middle third of every segment, forever. Length → 0, yet uncountably many points remain.
Koch curve
D = log4/log3 ≈ 1.262
Replace the middle third of each segment with two sides of an equilateral triangle. Total length diverges as the level increases.
Sierpinski triangle
D = log3/log2 ≈ 1.585
Subdivide into 4 half-triangles and drop the middle one. Three self-copies at half scale.
Generative algorithms
Four generators, one for each mechanism above. Adjust the parameters with the controls and re-run. In every case colour encodes a measured quantity rather than serving as decoration.
Barnsley fern
Physical analogue: a fern frond, whose leaflets are approximate scaled copies of the whole leaf.
Four affine maps applied with fixed probabilities (the chaos game). One map (probability 0.85) reproduces the main frond at reduced scale; two maps (0.07 each) generate the left and right leaflets; one map (0.01) traces the stem. Colour is mapped to height, from dark green at the base to light green at the tips.
Fractal tree
Physical analogues: a tree, the bronchial tree of a lung, a river network, and neuronal dendrites.
A single rule applied recursively: each branch bifurcates into two shorter branches at a fixed angle. Line width and colour encode the recursion depth, from brown at the trunk to green (or autumn tones) at the twigs. The tree is drawn one generation at a time and stops once the selected depth is reached.
Diffusion-limited aggregation
Physical analogues: coral, lichen, window frost, mineral dendrites, and dielectric breakdown (lightning).
A seed is fixed at the centre. Particles enter from the boundary on random walks and adhere on first contact with the cluster. Because the outer branches intercept most incoming particles, growth concentrates at the tips, producing a branched, self-screening structure. Colour encodes arrival time, from the earliest core to the most recent tips.
Julia set
Morphology depends on the constant \(c\): connected lobes, dendritic filaments, or spiral bands resembling sea-horse tails and shell whorls.
Each pixel is an initial value \(z_0\); iterate \(z_{n+1}=z_n^2+c\) and colour by the number of steps for \(|z|\) to exceed 2 (non-escaping points form the filled set). The Morph control varies \(c\) along a circular path: the set is connected when \(c\) lies in the Mandelbrot set and disconnected (a Cantor dust) otherwise. Colour is the normalised (smooth) escape rate.