Stung Eye
Stung Eye

« [Feb 9] Ordered Chaos
Ordered Chaos Revisited

Experimentation. Familiarization. It's all a nature walk. [Feb 16] »

After spending an hour zooming ("The 'Invisible' videos zoom in on matter and show you what is actually there, although invisible to the naked eye.") I knew what had to be done. I spent the last two days learning a new programming language called Processing. It's like Flash for programmers, (a simplified java syntax with a powerful graphics API.) During this time I wrote a small Mandelbrot exploration program.

The following applets require that your brower supports java.

Click to view Mandelbrot exploration applet. (Source code available.)

Click anywhere on the fractal plane to double the magnification. Zoom out by holding down any key and clicking the fractal. (The view centres on the clicked position for both in/out zooms.) 15 zooms are possible before floating point rounding errors erode the image. (Is that 65536X magnification?) The maximum number of Mandelbrot iterations is increased by 15 for each level of zoom, (improving the Mandelbrot resolution).

With the Flash apps from the last post, the pixel resolutions were poor, (4x4 pixel to 10x10 pixel representations for each fractal test point.) The pixel resolution of the processing applets is 1x1. The number of calculations being performed compared to the Flash generators has increased by many fold. To improve the rendering time I coded a recursive rectangle approximation engine.

Click to view Mandelbrot exploration applet in approximation debug mode. (Source code available.)

In debug mode you can see that the applet calculates the image as a gradient of bounded rectangles. I was able to exploit an interesting property of the Mandelbrot set, it is simply connected. This means that if any solid shape can be drawn on the set, where the shade/colour is identical for all the boundary points, this shape can be filled in with said shade/colour. The approximation engine divides the screen into four quadrants, a test is performed to determine if the quadrants can be filled in. Each quadrant that cannot be filled is further divided unto four quadrants of it's own. And the process repeats. (Division stopping only when a quadrant is filled or has reached a size of 2 pixels or less in either width or depth.)

This save us the trouble of calculating the escape velocity for every single pixel.

Related: fractal-like images of plants from the cabbage family.


Some Flash and Processing links:

  • - Flash experiments with source code.

  • - Flash and Processing experiments and sketches. (Source code also present.)

  • Bit-101 and the amazing Bit-101 forums.


  • Will you accept this coffin - A look at the realities of reality show dating.

  • mundane photos

  • Awe-inspriring structures in plants.

  • Stephen Wolfram's A New Kind of Science free online.

  • What else was Lost In Translation.

  • Your daily funk and hip-hop fix at WeFunk.

  • The Mushroom house is now officially grown. The interior design is based on the anatomy of a tree. Wow, it's for sale. (via lorbus)



  • Creative Commons License Valid CSS!