Barnsley Fern
The Barnsley Fern is a fractal built from four tiny formulas. Start at the origin and, over and over, pick one affine map at random. Tens of thousands of points later, a black spleenwort appears. Every leaflet is a smaller copy of the whole frond, so the picture stays detailed at any zoom.
How it works
- Open this page and watch the fern fill in from the chaos game.
- Drag to move and scroll to zoom. A leaflet is the same fern, drawn smaller.
- Switch variety, colour points by which transform drew them, or nudge curl and leaflet size, then save a PNG.
Four maps, one frond
Each step applies \(f(x,\,y)=a\) matrix times (x, y), plus a shift. The black spleenwort uses four of these maps. One draws the stem and is chosen about 1% of the time. One copies the fern into a smaller leaflet higher up the stem and is chosen about 85% of the time.
The other two draw the lowest left and right pinnae and are chosen about 7% each. Because those pinnae are themselves copies of the whole fern, the side branches appear on their own.
The chaos game
The first point is the origin. Each new point is the image of the previous one under a map chosen with the probabilities above. Plot enough points and the cloud settles on the fern. The same coefficients always make the same shape. The classic frond sits in about \(-2.18<x<2.66\) and \(0\le y<10\).
Mutants and self-similarity
Change the coefficients and the plant changes. Thelypteridaceae and Leptosporangiate are published four-map cousins of the black spleenwort. Curl leans the stem. Leaflet size scales the two side maps. Colour by transform paints stem, successive leaflets, left pinna, and right pinna in different colours, so you can see which formula drew each point. Scroll in: the detail does not run out.
Using the app
Watch the fern grow, zoom into a leaflet, or nudge the coefficients.
Frequently asked questions
What is the Barnsley Fern?
A fractal Michael Barnsley introduced to look like the black spleenwort fern, Asplenium adiantum-nigrum. It is an iterated function system: four affine maps, repeated, draw the whole plant.
What do the four transforms do?
One maps every point onto the stem. One makes the next smaller leaflet up the stem. One draws the large left-hand pinna, and one draws the large right-hand pinna. The side pinnae contain smaller copies of the same fern.
Why can I zoom forever?
The fern is self-similar. Each leaflet is the whole frond after one of the maps, so a closer view is another copy of the same construction, not a blur of a fixed drawing.
What is a mutant variety?
The same four-map recipe with different coefficients. Thelypteridaceae and Leptosporangiate are two published mutants. Curl, leaflet size, and Randomize move the coefficients further, which is the idea behind Barnsley's superfractals.
How do you draw the Barnsley fern?
With the chaos game. Start at any point and, again and again, apply one of the four maps chosen at random: the stem map 1% of the time, the next-leaflet map 85%, and each side-pinna map 7%. Plot every point and the fern appears after a few thousand; the app plots up to 2 million.
巴恩斯利蕨: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device.Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner.The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF.You can add one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
前往編輯器