So here's a true story on how I got the idea for this:
Once during a math lesson about essential spacial vector addition, which was boring for me, I was thinking about mathematical stuff. These thoughts then went over to the Feigenbaum diagram and took a turn to the fact that the Diagram has an appearance in the mandelbrot fractal (You can see both in my scenes). I began thinking on why that connection may exist and how I could prove it. Suddendly I got an idea on how this connection may be existent, and after some paper tests and formulas in my calculator, I found out that Functions of the type ((x*x+x)*x+x)*x+x)... take the form of the diagram, which explains the connection. At home I started coding a program with the task of running the common logistic equation x=r*x*(1-x) and map all points below 2. Interrestingly enough I did not get the fractal, but only its left half mirrored, meaning the logistic function's diagram did in fact not have the "true" connection, but only the feigenbaum diagram itself which was created out of coincidence by both formulas. I checked what would come out with the mandelbrot formula, which did result in the "correct" image. Since the program completed it's task, I started experimenting. After all, an algorithm able to map recursive functions as complex images is not something you have everyday. After enhancing it a lot, and then having the idea of copying the result to algodoo, this came out.
The more interresting part:
How do you use this scene? In the center, you have a 40x40 grid of pixels mapping over a 5x5 area of a complex Function. Complex functions are normal functions running with complex numbers instead as both the parameter and result. This would result in a 4D graph, which is reduced to 2D by replacing the result number with a color depending on the angle(hue) and absolute value(brightness) of the result (further explanation to these values in my Complex numbers explained scene). Additionally, these functions can be recursive. Inside the code box you have the code mapping the function, a huge selection of mathematic operations, and the function itself. To write your own complex function, go to the "_interface" variable. It is the only region you should edit, since everything else was made for you. Write your function by first declaring the starting value of _z in the first line(all complex numbers are written as [x,y]). This can be a number(usually [0,0]), or a variable like _x, for example in julia sets. Then continue with the for-loop. Should you not want a recursive function, just ignore values like _z and only work with _x or other parameters you added.
Now you can write the actual function using the given _operations. I recommend to do 1 operation per line to keep your function ordered, but it is not necessary.
Here are some info's about all operations:
abs: The absolute value of the complex number; In: 1 Complex number, Out: 1 Real number
cosine: The cosine value of the number; In: 1 Complex number, Out: 1 Complex number
dividedBy: Divides the first number by the second; In: 2 Complex numbers, Out: 1 Complex number
exponential: Takes e to the power of your number; In: 1 Complex number, Out: 1 Complex number
inverse: Calculates the inverse of the number; In: 1 Complex number, Out: 1 Complex number;
---log---: Calculates the natural logarithm(opposite of exponential) of the number; In: 1 Complex number, Out: 1 Complex number
minus: Subtracts the second number from the first; In: 2 Complex numbers, Out: 1 Complex number
plus: Adds the two numbers; In: 2 Complex numbers, Out: 1 Complex number
---power---: Takes the complex number to the power of the real number; In: 1 Complex number, 1 Real number, Out: 1 Complex number
sine: The sine value of the complex number; In: 1 Complex number, Out: 1 Complex number
tangent: The tangent value of the number; In: 1 Complex number, Out: 1 Complex number
times: Calculates the scalar multiple of the 2 numbers; In: 2 Complex numbers, Out: 1 Complex number
A list of all operations is inside the scene for lookup.
Should you find interresting functions, have questions or suggestions for a scene, post it in the comments to let me know! I will check your function in my java program and if it looks cool i'll add the HD version to the scene! Also be so nice and take the time to rate the scene in order to make it last a little longer. Of course it is impossible to make hi-res-images of the most beautifull functions here, but it enables some playing around nontheless!
Also please note that power and log dont work yet since I need a source for the natural logarithm and wasnt able to find one. Should algodoo not have one, I will need to find a universal algorithm to approximate it.
Some formulas:
|Before the for func.| _z = [0,0];
_z = _plus(_power(_z,2),_x) - Mandelbrot
|Before the for func.| _z = _x; c = [some complex number];
_z = _plus(_power(_z,2),c); - Julia fractals!
|Before the for func.| _z = [0,0];
_z = _times(_cosine(_z),_sine(_x)) - The thumbnail function(which is really cool if you have my java program to render it HD)
|Before the for func.| _z = _x;
_z = _dividedBy(_x, _minus(_z, _inverse(_z))) - Function with lots of 0-Points and ∞-Point
|Before the for func.| _z = [0.5,0];
_z = _times(_times(_x,_z),_minus([1,0],_z)) - Feigenbaum Equation and the mandelbrot half!