experiment 037 · fractal geometry · iterated function system
Barnsley Fern
An iterated function system (IFS) constructed from four affine transformations. By repeatedly applying these simple rules to a single point, a mathematically precise, self-similar structure of a fern emerges.
The Algorithm
The Barnsley Fern is generated using an Iterated Function System (IFS), a method for creating fractals resulting from a set of mathematical rules. In this case, there are four affine transformations applied sequentially to a point $(x, y)$.
Transformations
Each transformation represents a different part of the fern, and is chosen randomly with a specific probability at each iteration step:
- Stem (1% probability): $x_{n+1} = 0, \quad y_{n+1} = 0.16 y_n$
- Smaller leaflets (7% probability): $x_{n+1} = 0.2 x_n - 0.26 y_n, \quad y_{n+1} = 0.23 x_n + 0.22 y_n + 1.6$
- Largest left-hand leaflet (7% probability): $x_{n+1} = -0.15 x_n + 0.28 y_n, \quad y_{n+1} = 0.26 x_n + 0.24 y_n + 0.44$
- Successive smaller leaflets (85% probability): $x_{n+1} = 0.85 x_n + 0.04 y_n, \quad y_{n+1} = -0.04 x_n + 0.85 y_n + 1.6$