One thing is for sure, many of the fractals that have been discovered are incredibly similar to real life. An example is Barnsley's Fern, a fractal generated from an iterated set of functions that looks an awful lot like ferns we see in nature. Here's a picture for you:

This image is generated using the following algorithm:

x, y = 0.0, 0.0 loop until satisfied: draw x, y x, y = random_func(x, y)What random_func() does is applies a random linear transformation to the pair (x, y), chosen from a group of 4 possible transformations each with a specific probability. You can see the transformations on the Wikipedia page, or in my version of the code here. If you don't feel like going that far, a linear transformation is just where you take the vector (x, y) - let's call it v - multiply by a matrix and then add a constant vector:

v = A * v + aIn the fern drawing you would choose a random transformation, which is just a pair with a matrix and a vector to plug into the above formula. Different transformations will give you different shapes of the fern, feel free to play around and see what you get.

It's truly amazing how something so familiar can be generated using such a simple formula. I'm hoping to dig up some more things like this and hopefully post them here for all of you to see.

## 1 comment:

Nice post. You probably would enjoy Stephen Wolfram's (creator of Mathematica)TED speech http://www.youtube.com/watch?v=60P7717-XOQ He touches on the point you are sharing here; how seemly complex patterns can arise from simple equations.

Post a Comment