By Martin / Other, The Lab, JavaScript / Saturday October 18th, 2008 / No comments
I haven't been writing things for a while, partly because I have been taking a break from web development to work on a renderer for the Mandelbrot set (more information on the actual set can be found at the Wikipedia article on the topic).
The algorithms used to generate the set are not complex, and can be found on the Wikipedia page. The method I used was the simple one - the escape time algorithm.
First, I attempted to write a simple JavaScript script that used the canvas HTML 5 element to draw the set. However, due to limitations in the computational power of browsers, the resulting application was rather slow. The page can be viewed here: http://lab.aspektas.com/mandelbrot/mandelbrot_js.html.
So, I had to look around for another programming environment. In the end, I chose Flash, because it has a ready-made interface for graphics through its Display object, it is fairly fast, and it is alot like JavaScript, meaning that my original JS code didn't have to be changed much.
The final product can be viewed in The Lab: mandelbrot_flash.html (requires Flash Player 9). The source can be downloaded from here. The program is not very complex - you can zoom in and out, and change the quality at the expense of efficiency, but you can't pan. In my opinion, however, it is quite good, considering I have never used Flash or ActionScript before, and, well, it serves its purpose. Enjoy.
∎
I hope you enjoyed reading this article. If you wish, you may view some of the other recent or popular things I have written, or subscribe to receive RSS updates. You can also add a comment, or share this article on Twitter or Facebook, below.
Website copyright © Aspektas 2009 - 2010 Valid XHTML 1.0 Strict and CSS 2.1