Title: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 08, 2006, 09:45:52 PM [EDIT 11/09/06]
Hello! Z^2 + c : aa = a * a; bb = b * b; a = aa - bb + x; b = 2 * a * b + y --------------------------------------------------------------------------------------------------- how looks the equation for Z^4, and Z^5 ? Greetings, M. Vernaglione http://www.maverdigitalarts.de/fracts/ms.jpg Title: Re: Searching formula / equation for z^4 and z^5 Post by: lycium on November 08, 2006, 11:00:03 PM hmm those look pretty much like cubic (z^3) and quartic (z^4) to me.
as for the formula/equation, you have it already: z <- z^n + c if you're looking to get it in terms of scalar (real and imaginary) components, just work it out: let z = a + bi, then z^2 = (a + bi)(a + bi) = a^2 + 2abi + (bi)^2 = (a^2 - b^2) + (2ab)i z^3 = z^2 * z = [(a^2 - b^2) + (2ab)i](a + bi) = a(a^2 - b^2) + bi(a^2 - b^2) + ... have fun :P i suggest you write a few routines to handle complex number arithmetic; even if a few optimisation opportunities are missed when using this approach it's much better for experimentation/sanity. Title: Re: Searching formula / equation for z^4 and z^5 Post by: lycium on November 09, 2006, 12:18:10 AM aa = a * a; bb = b * b; a = aa - bb + x; b = 2 * a * b + x that's incorrect btw, since the last line would use the new value of a (computed for the next iteration) instead of the old one. what's more, the complex constant c has both an imaginary and real part, not just a single "x". new_a = a * a - b * b + c_a; new_b = 2 * a * b + c_b; a = new_a; b = new_b; Title: Re: Searching formula / equation for z^4 and z^5 Post by: Nahee_Enterprises on November 09, 2006, 09:59:48 AM hmm those look pretty much like cubic (z^3) and quartic (z^4) to me. The images are labeled correctly, they do not look like the z^3 and z^4, respectively. There usually is always one "bulb" less showing than what the power is raised to: z^2 = 1 Mbrot bulb z^3 = 2 Mbrot bulbs z^4 = 3 Mbrot bulbs z^5 = 4 Mbrot bulbs etc.... Title: Re: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 09, 2006, 09:11:46 PM that's incorrect btw, since the last line would use the new value of a (computed for the next iteration) instead of the old one. what's more, the complex constant c has both an imaginary and real part, not just a single "x". Youre right, it was a typo... Title: Re: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 09, 2006, 09:16:47 PM .... if you're looking to get it in terms of scalar (real and imaginary) components, just work it out: .... Hello! Thank you very much fo the suggestions, but that is too high for me. I am not a mathematician, nor i have any clue how to handle with complex numbers. What i asked for is the translation of these formulas into simple to write instructions for any language, in this case those like Basic, or the Java implementation in /Processing/ Greetings, Marco Vernaglione Title: Re: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 09, 2006, 09:28:55 PM aa = a * a; bb = b * b; a = aa - bb + x; b = 2 * a * b + x that's incorrect btw, since the last line would use the new value of a (computed for the next iteration) instead of the old one. True, i just typed incorrectly. The lines in any Basic or Processing code looks like that: aa = a * a; bb = b * b; twoab = 2 * a * b; a = aa - bb + x; b = twoab + y; Greetings, M. Vernaglione Title: Re: Searching formula / equation for z^4 and z^5 Post by: lycium on November 10, 2006, 09:45:15 AM the maths isn't difficult, only tedious; you just have to remember that i^2 = -1, multiply everything out (you only can save a little on the working out if you re-use the expression for z^2 to get z^5), apply the said identity after each step, collect the real and imaginary terms.
anyway a way around this is if you want to experiment quickly (short of using maple/mathematica to boil down every formula) is to just make a bunch of utility functions for adding/subtracting, multiplying/dividing (latter needs the conjugate), argument and radius. these are pretty standard and you can find code for this anywhere - i bet java (proce55sing is java right? read a bit about it, haven't used it) has a complex number class built in already. [aside: in c++ you can just write z_new = (z * z + c * z + b) / (z * a - z.conjugate() * b) or whatever; the particularly nice thing is the natural (infix) ordering - as it's written - whereas things like c = complex_add(a,b) require you to work stuff out in postfix ("stack") order.] Title: Re: Searching formula / equation for z^4 and z^5 Post by: lycium on November 10, 2006, 09:54:48 AM The images are labeled correctly, they do not look like the z^3 and z^4, respectively. ah yes, i was confusing it with the julia set, where it defines the order of symmetry (via the partition of unity). Title: Re: Searching formula / equation for z^4 and z^5 Post by: lkmitch on November 14, 2006, 04:16:39 PM Z^2 + c :
aa = a * a; bb = b * b; a = aa - bb + x; b = 2 * a * b + y --------------------------------------------------------------------------------------------------- how looks the equation for Z^4, and Z^5 ? Another approach is to use Pascal's Triangle: 0: 1 1: 1 1 2: 1 2 1 3: 1 3 3 1 4: 1 4 6 4 1 5: 1 5 10 10 5 1 etc. The interior elements of each row are the sums of the two neighboring elements in the row above. If you use the row number as the exponent of (a + ib)n, then the row elements give the coefficients. Of course, you then need to sort out the powers of i and the real and imaginary parts. So doing: 0: 1 1: a + ib 2: a2 + 2iab + i2b2 = (a2 - b2) + i(2ab) 3: (a3 - 3ab2) + i(3a2b - b3) 4: (a4 - 6a2b2 + b4) + i(4a3b - 4ab3) 5: (a5 - 10a3b2 + 5ab4) + i(5a4b - 10a2b3 + b5) etc. Kerry Title: Re: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 20, 2006, 10:23:09 PM Well, i still have no clue how to translate the equations into a common programming languages
kind of notation. I thought someone could be so gentle to write it down or maybe point to other references. I need the lines of code for an experiment :-) Greetings, Marco Vernaglione Title: Re: Searching formula / equation for z^4 and z^5 Post by: lycium on November 20, 2006, 10:35:49 PM hmm i hope this will be taken as it's intended...
i think you'll get a lot further with your experiments if you accustom yourself to i^2 = -1 and converting basic expressions to code. it's not difficult, very rewarding, and ultimately worth the time spent mastering it if you intend to do anything more than just julia sets. relying on other people for your experiments is a really heavy set of crutches to bear; i hope you'll look at the sheer potential for experimentation you'll gain through a greater understanding of programming and the complex numbers, and want it enough not ignore it! it's somewhat harsh to say it like that (i have similarly unpopular views of people dependent on antidepressants), so in order to take my judgement of whether i'm doing good or harm out of the equation i'll put the code solution here. i hope this will not reduce your will to derive the code and equations yourself. lkmitch gave the expression (a^5 - 10a^3b^2 + 5ab^4) + i(5a^4b - 10a^2b^3 + b^5), which translates directly to new_a = (a*a*a*a*a) - 10 * (a*a*a) * (b*b) + 5 * a * (b*b*b*b) new_b = 5 * (a*a*a*a) * b - 10 * (a*a) * (b*b*b) + (b*b*b*b*b) a = new_a b = new_b it's possible that this can be made more efficient by defining constant variables for powers of a and b (i can see a^2 and b^2 coming in handy), but that's perhaps best left to the compiler. and since you're using java you've no way to grok what's finally happening in the virtual machine anyway, not to mention the fact that performance isn't really java's selling point ;) Title: Re: Searching formula / equation for z^4 and z^5 Post by: maverdigitalarts on November 21, 2006, 11:23:21 PM hmm i hope this will be taken as it's intended... Thank you a lot, i took it as intended. :-) Please believe me that i never had an extended understanding about complex math. I had my difficulties with binoms and algebra in the school years, which i mastered satisfignally... just knew the equations of complex iterations from two magazines ( both Scientific American ), from which i tried to program the mandelbrot. Got it after many mistakes. And now its going on to 3d Fractals. The way i am doing all of my works is to experiment like an alchemist, playing with the stuff... If i would be a student, i really would be more into deeper understanding. Just actually something else is more essential. Therefore i joined Fractal Forums for assistance. Applied your Maths.... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The Julibrot variation caused a spiky Mandel Type, with all four extensions... which if i could impose some trigonometry, could be transformed into the "bulbs" which i depicted in my introduction. The "Bicomplex" variation caused a "borg cube" alike object, which i am to be rendering. [EDIT 24th, November, 2006] (http://www.maverdigitalarts.de/fracts/BorgBrot.jpg) Title: Re: Searching formula / equation for z^4 and z^5 Post by: cKleinhuis on November 26, 2006, 03:20:59 PM expanding the formula for each number would be quite an effort, instead you should consider using a formula to raise a complex number to any complex number ( including any real number), here is a link which should provide you with the neccesary informations: http://home.att.net/~srschmitt/complexnumbers.html |