views:

565

answers:

6

Fractals have always been a bit of a mystery for me.

What practical uses (beyond rendering to beautiful images) are there for fractals in the various programming problem domains? And please, don't just list areas that use them. I'm interested in specific algorithms and how fractals are used with those algorithms to solve something in practice. Please at least give a short description of the algorithm.

+14  A: 

Absolutely computer graphics. It's not about generating beautiful abstract images, but realistic and not repeating landscapes. Read about Fractal Landscapes.

Perlin Noise, which might be considered a simple fractal is used in computer graphics everywhere. The author joked around that if he would patent it, he'd be a millionare now. Fractals are also used in animation and lossy image compression.

Kornel Kisielewicz
Another example of fractals used in computer graphics would be generating realistic looking plants: http://en.wikipedia.org/wiki/L-system
Sami
+3  A: 

Fractals are used in finance for analyzing the prices of stock. The are also used in the study of complex systems (complexity theory) and in art.

Paul

Paul
You have any specific algorithms in mind where fractals have been shown to be practically useful in analyzing prices of stocks? In the link you gave, the author finishes up by saying that the hurst exponent estimation (what he was doing) seemed to be of little use for analyzing financial time series. How about some examples on what algorithms are used with study of complexity theory for achieving something practical with fractals?
Sami
+2  A: 

Fractal image compression. There are some more applications thought not all in programming here.

Noufal Ibrahim
Do you have any specific examples of fractal image compression algorithms that people would be well served to know about?
Sami
I'm afraid not. I was exposed to the algorithms around a decade ago but haven't rally kept up.
Noufal Ibrahim
That's because fractal image coders simply have not gained traction over transform coders.
Steve
+8  A: 

A Peano curve is a space-filling fractal, which allows you to cover a 2-D area (or higher-dimensional region) uniformly with a 1-D path. If you are doing local operations on a multidimensional array, storing and/or accessing the array data in space-filling curve order can increase your cache coherence, for all levels of cache.

comingstorm
A Hilbert curve is another example of this. See my post for a practical implementation: http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves
Nick Johnson
If I remember rightly, the Sega Dreamcast's 'swizzled' texture format used this to get a higher cache hit rate on their tile-rendering graphics architecture.
matja
+1  A: 

Error diffusion along a Hilbert curve.

It's a simple idea - suppose that you convert an image to a 0-1 black & white bitmap. Converting a 55% brightness pixel to white yields a +45% error. Instead of just forgetting it, you keep the 45% to take into account when processing the next pixel. Suppose its value is 80%. Normally it would be converted to white, but a neighboring pixel is too bright, so taking the +45% error into account, you convert it to black (80%-45%=35%), keeping a -35% error to be spread into next pixels.

This way a 75% gray area will have white/black pixel ratio close to 75/25, which is good. But if you process the pixels left-to-right, the error only spreads in one direction, which yields worse looking images. Enter space-filling curves. Processing the pixels along a Hilbert curve gets good locality of the error spread. More here, with pictures.

Rafał Dowgird
A: 

go fractals!! for all fractal questions check out https://sites.google.com/a/stjoebruins.com/shap-mac-s-fracs/

Mac