Thursday, January 6, 2011

Programming Fractals Part One

Most people have short but frequent blocks of free time.  These are commonly called weekends.  They come once a week but one rarely has enough time to complete a major project.

However, I am currently a grad student.  That means my free time comes in large but very infrequent chunks, like Spring Break and Winter Break.  So what does a math geek with computer programming experience do on Spring Break?  Allow me to share what I did.

On one of the Internets, I found some C-code that painted interesting fractal pictures.  First, I had to get the code to work on my machine.  This required downloading a free copy of Visual C++.  (I know what you're thinking: Micro$oft gave away a free copy of their software?  I couldn't believe it either, and there have been no bad effects, either.)  The "readme" file with the code also suggested getting GIMP, so I did.

(GIMP is an acronym that stands for GNU Image Manipulation Program.  If you don't know GNU, think "open source."  Personally, I believe in open source software when I can't afford a program like Photoshop.  For my image manipulation needs and abilities, GIMP is more than adequate, and you can't beat the price.  It cost me as much as Visual C++ did.)

So then I was up and running.  It turned out that the code I downloaded created "buddhabrot" fractals.  These are basically Mandelbrot sets but with a totally different coloring algorithm.  Allow me to explain how it works: Click Here.  I'll wait.  Really, you want to read this, it's way cool.  What?  You'd rather read something quick and get back to this blog?  OK, here's Wikipedia.  All right, are you back?

Here is the buddhabrot I drew with the downloaded code.


Pretty cool, huh?  (You really should go back and read that first link by the creator of the buddhabrot.  Seriously, I'm not going to explain it to you.)

I love the other-worldly nature of this picture.  However, there were a couple things I wasn't crazy about.  The first, and not as important, was that it took a long time to create.  This is to be expected, since the buddhabrot algorithm takes twice as long anyway.  But you already know this because you read the links above.  I would have been happy to create buddhabrots while sleeping or something, so this wasn't that big a deal (until I came across something faster).

The second thing about my buddhabrot images was that they were simply images.  I can't zoom in closer to look at the internal structure.  That's one of the best things about Mandelbrot and other escape-time fractals: you can zoom in thousands of times and still see minute detail of the chaotic borders.  (More on that to come.)

But I was far from disappointed.  I was able to begin my fractal addiction by manipulating the equation that creates the fractal.  I'll explain the equations later. Allow me to close with the other buddhabrot-type images I created.  Next time: Summer Break!

          Cubic Mandelbrot


 
Quartic Mandelbrot


                                                                          Mandelbar    

No comments:

Post a Comment