Fractal Vector Fields
Ivan Freyman, 03/18/2010

Any point iterated with a fractal formula such as z=z2+c will have what is commonly referred to as an "orbit". It's the path a point takes as it hops from place to place on the complex plane. Sometimes these orbits will take the point to infinity; other times the orbits will steadily oscillate between several values, and another possibility is that the orbit will spiral into a fixed location. Regardless of what the orbit does, it will always have a specific magnitude and direction (vector) at each iteration. If we calculate the orbital vectors for a grid of points across any fractal in the complex plane, and we slowly change some variable in the formula for each frame of a movie, we will get a moving vector field. Below are the results of my programming experiments with this idea.

Side note: A true vector has both magnitude and direction, yet the vectorial elements in the movies below are all of equal length. I initially made the lengths proportionate to the vector magnitude but they invariably got too long and overlapped, so the whole scene became cluttered and aesthetically unappealing. My solution was to have the magnitude affect the vector's color. This way the magnitude data would be preserved and visible, yet the field would remain nice and neat.

In the first movie on the left, we see a morphing Julia set. The Julia constant starts off outside the Mandelbrot set and then spirals in to 0+0i. At some point in the movie, all vectors grow and shrink in unison, just for effect. In the second movie, we zoom into a Julia set composed of rotating vectors. The third movie is a magnification of the the Julia set in the second one. The fourth movie is of a low-iteration Mandelbrot set with the addition of a variable to the Mandelbrot formula: z=z2+c+x where x grows from to +π

Vectors to Colors

As the title implies, instead of drawing an arrow we can draw a pixel whose color corresponds to the vector direction. Two movies below (left and center) map the vector direction to a standard HSV color wheel. The center movie focuses on the primary colors only (red, green, blue and cyan, magenta, yellow) while keeping all other pixels black so as to achieve a color banding effect. This creates sharp boundaries and makes it easier to see the wave-like motion (thanks to Carl Weiman for suggesting this coloring technique). On the right is a morphing Julia set whose seed point traces a semicircle inside the top half of the Mandelbrot set's main body. It has nothing to do with vectors but it's still fun to watch.

Orbit Traps

If an orbit gets too close to one of the axes, iteration is halted and the currently iterated point is colored in proportion to the distance to the axis. This kind of trap produces straight stalks as seen in the image below on the left, but I wanted to create sinusoidal stalks. I've never seen it done before but figured it would look neat. Second from the left is a "zero" Julia set (the Julia constant is 0+0i) The others have constants (.32, .043i), (.32, .03822i), and (.32, .043i).

The picture on the far right does not have an orbit trap. Each pixel's color is based on the total distance traveled by a point's orbit after 71 iterations, provided the point does not escape to infinity. Points that escape are colored black.