The Barnsley fern was discovered by Michael Barnsley in the 1980's while he was looking for a way of describing complex images using a very small amount of information.
The fern, especially when drawn using semi transparent coloured pixels, creates a stunningly beautiful and realistic image of a fern leaf - but it is also drawn with a very small amount of information using a simple calculation repeated many times using a computer.
Michael Barnsley describes the discovery/development in the book 'Fractals Everywhere' first published in the late 1980's. The work would have helped in the development of the JPEG image compression algorithm that is used in every digital camera for storing large images using a limited amount of memory.
The fern algorithm uses only 20 numbers which are used in 1 of 4 randomly selected functions.
It can be thought of as the fern 'existing' in a very small region of a large 20-dimensional room which Michael Barnsley discovered!
Below is a video clip of a zoom into the fern and then an animation sweeping across one of the dimension in the 20-dimensional 'room'. About 50s in the video shows the changes in the resulting pattern of points when the 2nd b value in the code below is changed from 5.7 to -2.5.
The algorithm show in the slides in the video can be written in code as follows:
// Code to plot 10000 pixels of the Barnsley fern:
x=0;
y=0;
for(i=0; i<10000; i++){
r=random(1);
if( r<0.02 ) { a=0; b=0; c=0; d=0.16; f=0; }
else if( r<0.89 ) { a=0.85; b=0.04; c=-0.04; d=0.85; f=1.6; }
else if( r<0.96 ) { a=0.2; b=-0.26; c=0.23; d=0.22; f=1.6; }
else { a=-0.15; b=0.28; c=0.26; d=0.24; f=0.44; }
xs = x;
x = a*x + b*y;
y = c*xs + d*y + f;
plotPointAt( x, y );
}
A higher resolution HD Youtube clip is at Barnsley fern with b_2 changing
A java app (jar file) can be downloaded from here: fern.jar which displays the result of the code above. You can adjust any of the 20 numbers, searching the 20-dimensional room!