# How can I make my own fractals?

by piercebeatz
Tags: fractals
 P: 192 Hello everyone. You probably all know about the Mandelbrot set. I am not here to ask questions about the set itself, but how I can graph fractals similar to it. Is there a program where I can input my own equations? Or would I have to be a java expert to do so? The fractals that I want to make are similar to the Mandelbrot set: I want the computer to color a point black if the point converges after a number of iterations and I want to color the points that do not converge according to escape time. By the way, I don't know the first thing about programming/computer science.
 PF Patron Sci Advisor P: 1,332 Great link, that one. Thanks Borek.
P: 192

## How can I make my own fractals?

 Quote by Borek http://www.dmoz.org/Science/Math/Cha...ctals/Software
Would you recommend any of these in particular for a mac? I downloaded a few and most of them only allow you to examine preset functions. Do any of them allow you to input your own functions?

Also, I am worried that even if I find a decent fractal generator, it may not be able to do what I want. I am interested in generating a fractal where, in the style of the mandelbrot set, a point z is colored black if it converges for ##z^z^z...## and it is colored based on escape time if it diverges.
P: 192
Thanks a lot! That thing looks really cool! What did you change about the equation?
P: 935
 Quote by piercebeatz Thanks a lot! That thing looks really cool! What did you change about the equation?
I tried to use what I thought your equation was, that was to check z, z^z, z^z^z, z^z^z^z,... until that was either a distance of 2 or more away from the origin or until it had a stack of 20 exponents and I bailed out.

The fumbling around was trying to make the example as simple and understandable as I possibly could, so you or others could hopefully understand it and point out any mistakes.

If you are fairly sure what the equation should be then you might be able to calculate the result for some particular value of z. If you let me know what the values for z and powers of z are then I could see if I'm getting the same result you are. That might help expose mistakes.
 P: 166 I have a program that generates the Mandelbrot Set on my website. It's written in JavaScript and uses the new HTML 5 canvas tag. The source is cobbled together from a couple of other programs that I have referenced, and I have grand plans for it that include a much better color palette and much deeper zoom. You can view the source. I'm posting it because the program is actually very simple, and the platform (JavaScript/HTML5) is available to most anyone with a computer, without downloading any extra software. All of the meaningful code is inside the drawMandelbrot() function and all it does is set some initial parameters and then with a system of three loops, iterates over every x,y coordinate on the canvas (that's two loops, for all x, for all y) and then runs an inner loop (for i until max_iterations) to determine whether the complex number that defines that x,y coordinate (i.e 1 + 2i is x,y coord 1,2) is part of the set or not. The maths is very easy, and the program is too. As for generating other fractals, I have a program called ChaosPro but to be honest, I haven't used it much, or recently. I believe you can load new formulas as files and use it to generate your own, but you would have to investigate that yourself.
P: 192
 Quote by Bill Simpson I tried to use what I thought your equation was, that was to check z, z^z, z^z^z, z^z^z^z,... until that was either a distance of 2 or more away from the origin or until it had a stack of 20 exponents and I bailed out. The fumbling around was trying to make the example as simple and understandable as I possibly could, so you or others could hopefully understand it and point out any mistakes. If you are fairly sure what the equation should be then you might be able to calculate the result for some particular value of z. If you let me know what the values for z and powers of z are then I could see if I'm getting the same result you are. That might help expose mistakes.
You've got the idea, that's exactly what I want to do. How long did that take your computer to render? By the way, I was not even sure if it would be a fractal. I had no knowledge going into this what it might look like.

Edit: My math teacher suggested that I find a way to do this by iterations. I'll spare you the ugly work, but here is the value of ##(a+bi^{(c+di)}##:
$$(a+bi^{(c+di)}=(a^2+b^2)^{c/2}e^{-d*\text{arctan}(b/a)}\text{cis}(d*\text{ln}(a^2+b^2)/2)\text{cis}(c*\text{arctan}(b/a))$$

Thus, the iteration is:

$$a+bi \to (a+bi^{(c+di)}=(a^2+b^2)^{c/2}e^{-d*\text{arctan}(b/a)}\text{cis}(d*\text{ln}(a^2+b^2)/2)\text{cis}(c*\text{arctan}(b/a))$$

c+di is the complex number whose convergence we are testing. a+bi is the number that is obtained from an iteration. Thus, for the initial iteration, a+bi=c+di.
 P: 935 For the simple example I showed: about 35 seconds. Cut the step size in half, so 4x the points, and raise exponents to 40: about 5 minutes 40 seconds. I'm not sure whether doing the repeated multiplies would be slower than doing the arctan and cis and log or not.
 P: 192 Can I see the higher quality version?
 P: 935 Doesn't look much different to me Attached Thumbnails
 P: 192 This is great. It appears, at the bottom left and right of the set, that points outside the radius of 2 converge. Could you make try making the set bounded by a circle of radius 3?
 P: 935 I still have no idea whether this is correct or not. I'm guessing the wiki "diverges for x>2" may only apply for repeated squaring and not for your exponentiating In[1]:= ArrayPlot[ Table[n=0;z=a+I*b;r=z;While[Norm[r]<3.&&n<20,r=r^z;n++];n,{a,-3.,3.,.01},{b,-3.,3.,.01}] ] Out[1]= plotSnipped In[2]:= Export["zfrac3.jpg",%,ImageResolution->200] Out[2]= zfrac3.jpg Attached Thumbnails
 P: 192 Do you know what it means if an area is grayer than another area? Is that based on escape time?
 P: 935 The darker it is the more z's in z^z^z^z... were needed before the value of that became greater than 2 (or 3). So out side the circle of radius 2 (or 3) is white because it took zero exponents to be greater than 2 (or 3), in other words z was already enough. The slightly darker shade just inside the circle took one exponent, z^z to escape. The next darker shade in the "bands" on the "wings" took two exponents, z^z^z to escape. The black center did not escape in 20 (or 40) exponents.
 P: 191 around the one and a half second mark in Mathcad 15 on a Dell Dimension 521 (Athlon 54 dual-core 2.5 GHz with 4GiB RAM running Windows 7 32-bit) - the lighter the image, the quicker the escape. Around one second for an n=64 standard Mandelbrot over the same x and y ranges. Attached Thumbnails

 Related Discussions Differential Geometry 1 General Math 2 General Math 1 General Physics 4 General Math 3