•Site Index
•Top 15 Entries
•Contributors
•Submissions
•Guestbook
•Trackback
•Glossary
|
Welcome to the Kitopedia. All entries are © 2001-2007 Christopher Sunami, unless otherwise noted. All rights reserved. These entries are NOT publicly licensed. No entries may be reproduced without permission and attribution.
NOTE: Most essays on this site represent original theoretical work. If you find these articles interesting, inspiring or helpful, please let me know. If you refer to them, please give me and this website credit. In addition, links back to this page in blogs or from other sites are always appreciated! Search
Categories
Forums
Blogs
Bookmarks
Hero For Christ | Mandelbrot SetUpdated 6/24/08 Jump Straight To FractalI've been teaching myself Flash recently, and I chose this program, which renders the Mandelbrot Set together with the associated Julia Sets, as my practice project. I'm pretty happy with it --I'd even venture that it's probably one of the best free Mandelbrot Set explorers around, given that Flash only recently became fast enough for real-time rendering. (Note: I took some inspiration for this project from Milan Toth's version at gotoAndPlay).The math for the Mandelbrot Set is surprisingly easy, so the hard thing in creating this was learning how to use Action Script 3.0. It seems like it took a big jump in complexity from the last version --and there wasn't a lot of help available for a true beginner who hadn't used Flash at all before. I've posted the complete code for anyone else looking to learn Flash. As amazing as this fractal looks, the code that generates it checks in at a svelte 4K! Not 4MB, but 4K, or about a thousandth the size of a typical Flash program. About the Mandelbrot SetKnown as the "most complex object in mathematics" this beautiful and mysterious mathematical object is a graph on the complex plane, with the real component represented by the x values, and the imaginary component by the y values. The Set traces what values "escape" and what values are trapped when reiterating the equation"Zsquared + Zoriginal =>Znew" or in other words "the complex number Z squared plus its original value equals the next Z", which you could also write as "Zn+1=Zn*Zn+Z1". Some numbers under this process go to zero. Others go to infinity. In between are numbers which stay in the middle zone for a long time before going one direction or another. The beautiful colors are thus generated by measuring how long it takes a particular point to escape (go towards infinity, which in practice, means exiting the circle formed by the equation "real value squared+imaginary value squared>4" and coloring it accordingly. About the Julia SetsPerhaps the most stunning fact about the Mandelbrot Set is that it serves as the "index" to an infinite number of infinitely complex fractals known as the Julia Sets. The Julia Sets are formed in almost the same way as the Mandelbrot Set, except their equations are of the form"Zn+1=Zn*Zn+C" where C is not the initial Z value, but rather the value that centers that particular Julia Set. Since all Z1's in a given interval become closer and closer to any given C in that interval as the interval becomes smaller and smaller, this means that an extreme closeup of the Mandelbrot set becomes indistinguishable from an extreme closeup of the associated Julia Set at the point around which the Mandelbrot has been zoomed. About the MathIf you want to generate the Set yourself, you need the following heuristic.this is the core set of equations for the Mandelbrot" xnew= x*x-y*y+ x1; ynew= 2*x*y+y1;These equations are used because if you square a complex number of the form a+bi, you get a*a+2*a*bi+b*b*i*i by basic algebra. But i*i=-1, so if we let x=a and y=bi, we get the formulas above (after separating out the real and imaginary components). The equations for the Julia Sets are the same, except that a fixed set of center values is used rather than the particular x1,y1 being tested. xnew= x*x-y*y+ xcenter; ynew= 2*x*y+ycenter;Next you need a program that will gradually cycle through all the real and imaginary values in the area you are testing (usually between -2 and 1 on the real axis and -1.5 and 1.5 on the imaginary axis). As you reach each point, let it be your new x1 and y1. Cycle through your chosen set of equations over and over until you reach the maximum number of cycles you are testing (depending on the computing power you have available) or until the value goes to zero or "escapes" (passes 2 or negative 2 on the real or imaginary axis). Color the point represented by x1, y1 with the color representing the number of cycles the point required, and move on to the next point. When you have tested all the points, you will have your Mandelbrot (or Julia)! InstructionsMouseOver the Mandelbrot (on the left) to see the associated Julia Sets. The Shift Key will toggle the Julia Set tracker on and off, which is useful if you find a pretty Julia Set you want to capture. Click and drag an (invisible) rectangle on the left in order to zoom in on the Mandelbrot. Make sure you don't single click on the left or you'll zoom in infinitely (which probably won't look very interesting!). The leftmost set of numbers are the real and imaginary center points of the current image. The middle and last sets are the new minimum and maximum values when you zoom. The RESET button returns to the starting values.Note: If this application doesn't seem to work, you probably need the newest version of Flash. |