Blog  |   Puzzles  |   Books  |   About

Virgin Territory

While on a morning coffee run with a coworker, we chanced on the subject of religious experience, and I mentioned that exploring mathematics is the closest I’ve come to a religious epiphany. Although this notion is probably familiar to folks versed in the physical sciences, my friend was surprised to hear it. I brought up fractals made with complex numbers as an example, and was pleasantly surprised to find that my friend was unfamiliar with them.

On getting back to the office, I fired up a windows program I had written a couple of years ago.

“Look at this shape. Have you seen this before?” I asked.

“No,” my friend said, “it looks kind of like a Buddha!”.

My heart skipped a bit as I realized I was in the presence of a Mandelbrot virgin. There was only one thing to do. Zoom in!

So I pressed the left mouse-button and proceeded to give my friend a guided tour of the hidden buddha-nature of this complex landscape. It is always a pleasure to introduce the Mandelbrot set to a newbie. Zooming into it for the first time is like opening up a fresh jar of wonder.

My program exploits the acceleration on modern graphics cards to do fractal zooms in real-time. You use the left-mouse-button to zoom in, and the right-mouse-button to zoom out. There are various other keys that do things, but that’s all you really need. As I explored and explained some different locations in the mandelbrot set, my friend sat there and said “Wow!” repeatedly, as unjaded Mandelbrot virgins are wont to do.

This was also a good time to explain the bizarre concept of “imaginary numbers,” so I made a stab at that too. I must admit, I still find imaginary numbers damnably counter-intuitive. I’m just glad they make such pretty pictures! The only other time I’ve encountered them in my work is in making pretty music – they are also used in audio effects processing.

Later, when my friend asked for some links to some software for exploring the Mandelbrot set, I had a hard time (using Google) finding software that does these kind of continuous zooms (although I’m sure there is lots of it out there). There is tons of Mandelbrot software on the Internet (writing such programs is a common hobby for newbie graphics programmers). The heydey of Mandelbrot exploration was probably the late 80s and early 90s. The problem is that a good deal of the Mandelbrot software that is out there and easiest to find was written some years ago, and is designed to generate still frames only. So there’s a lot of noise covering up the good stuff, and a need for simple programs with more intuitive interfaces.

Then there’s my software. Even though it’s a bit half-baked and completely undocumented (I just wrote it for my own use), I thought I’d provide it here, for those that lack a suitable substitute. If you have a friend that is a Mandelbrot virgin, you too can add a little wonderment to their world.

Here is my program, MandelZoom. Like I said, windows only.

MandelZoom supports the following commands, which are single keystrokes:

Escape Quit the program
Home Reset
Page Up Change Rendering Style
Page Down Change Palette
f Toggle Full screen
j View corresponding Julia set
p Take a screen snapshot
arrows Pan

There are a few other hidden commands in there (+ – [ ] space), which I’ll leave undocumented, for messing with the colors. You’ll figure them out if you dig.

Although this is a windows program, the source code is fairly portable. At some point I’ll get around to putting up a Mac executable. If you’d like to compile it on another platform, and you’re familiar with OpenGL/GLUT programming, here is the source code. Don’t try this if you’re not an experienced programmer. I love getting your emails, but it is not a good medium for me to teach you C++. :) If you manage to do a successful port, let me know, and I’ll link to it below, when I update this post.

No doubt, there are much better programs out there, with the same real-time zoom capabilities. If you know of them, please tell us in the comments, and I’ll mention the better ones below as well.

UPDATE: Krazydad irregular Ryan Govastes points us to a more full-featured cross-platform program called Xaos. Oooooh. Smooth zooms! The first of many, I am sure.

2 Responses to “Virgin Territory”

  1. rgovostes Says:

    Xaos has always been my favorite, as it’s cross-platform and does real-time zooming into Mandlebrot and other fractals, but I’ll give yours a try too. Wikipedia also has a list of programs, but only Xaos and a Windows-only one called ChaosPro claims to do real-time.

    Xaos: http://wmi.math.u-szeged.hu/~kovzol/xaos/doku.php
    Wikipedia: http://en.wikipedia.org/wiki/Fractals

  2. Ben Key Says:

    Hello,

    I have ported your MandelZoom program to Linux. You may find my changes on my web site at http://sullivanandkey.com/svn/SnKOpen/cpp/MandelZoom/trunk/. I changed three files: MandelZoom.h, MandelZoomLocal.h, and Snapshot.cpp.

    There is one bug that I am still looking into. The screen constantly flickers and the window behind the MandelZoom window bleeds through.