# An Interesting (fractal) Formula

6 replies to this topic

### #1 Kharakov

Kharakov

Thinking

• Members
• 114 posts

Posted 09 November 2010 - 04:22 PM

It's a pretty straight forward rotation based fractal formula, but I really enjoy the complex patterns it generates (images follow):
victor=complex(sx,sqrt(sqr(sy)+sqr(sz)));       // complex (x,y) creates a complex variable with
bravo=complex(sqrt(sqr(sx)+sqr(sy)),sz);       // the x component corresponding to the real component
cramden=complex(sx,sy);                       // and the y being the imaginary component

r1=cabs(cramden)^-n;   //  cabs(XXX) calculates the magnitude of a number (complex, quaternion, or real)
victor=victor^n;
bravo=bravo^n;
cramden=cramden^n;

nx=part_r(victor);             // you might notice that I switched the new y and z components
ny=-abs(part_i(bravo));
nz=-abs(part_r(bravo)*part_i(cramden))*r1;

add in pixel or julia components  (use + absolute value for the y and z components unless you want a really weird distorted fractal)



Here are a couple z^2 to start:
Click fer a bigger image:

Yup, I said fer.

This is the above image, prior to zoom in, etc.

Different part of the fractal:

Then the kicker, the z^6 has some nice organic stuff in it (like brambles or somethin'):

And it (the z^6) has the tower stuff, but it's a bit more organic in sections:

As with all fractals, this one can be explored. Not really too familiar with it as of yet, as it's 3d and takes a bit of time to calculate on my computer. Eventually these 3d fractals will be as quick to calculate as 2d fractals are today... but that's the future...

### #2 Pyrotex

Pyrotex

• Members
• 5701 posts

Posted 09 November 2010 - 04:33 PM

It's a pretty straight forward rotation based fractal formula, but I really enjoy the complex patterns it generates (images follow)...

I'm totally impressed. Nice images.
However, I was unable to follow the code you provided. there were undeclared variables, and I saw no loop structure over the domain of the images.

### #3 Kharakov

Kharakov

Thinking

• Members
• 114 posts

Posted 09 November 2010 - 08:53 PM

I'm totally impressed. Nice images.
However, I was unable to follow the code you provided. there were undeclared variables, and I saw no loop structure over the domain of the images.

Durp... Apologies. Let me explain my formula, and ChaosPro's syntax a little better.

First of all, what I posted above is basically one iteration (one loop), WITHOUT pixel additions. I generally initialize sx,sy,sz to whatever seed values I want (0,0,0 usually) prior to the first iteration, adding in pixel values at the end of each iteration.

sx,sy,sz,nx,ny,nz are reals, they are like an extended double float, being 80 bit precision (14 bit exponent and 64 bit mantissa) rather than 64 bit

victor, bravo, and cramden are complex numbers with each component having the same precision as the reals (I use complex numbers instead of trigonometric functions because they are quicker, and I like them... remind me of 2d Mandelbrot)

victor= complex (1 , 2) sets the complex variable victor to 1 + 2i
bravo = complex (3 , 7) sets bravo = 3 + 7i
....

sx = starting x value of iteration
sy = starting y value...
sz = starting z..

nx = new x value prior to addition of pixel component (pixel for Mandelbrot type, Julia seed value for Julia type)
ny = new y value... // Add in pixel components for Mandelbrot type fractals
nz = new z.... // use absolute value of the y and z pixel components for a more uniform fractal (it's just nicer)

part_r (complex number) = real part of the complex number
part_i (complex number) = imaginary part...

cabs (complex number) = magnitude of the complex number
number^n = number raised to the nth power (for complex, real, or otherwise)

I suppose it's time to clean up my code yet again and post to ChaosPro's database. I've also a few coloring algorithms that bring out the structure of the fractal (or at least portions of it) nicely.

### #4 Kharakov

Kharakov

Thinking

• Members
• 114 posts

Posted 12 November 2010 - 12:42 AM

Here is a nice z^8 julia of this type (click to enlarge):

### #5 Don Blazys

Don Blazys

Questioning

• Members
• 439 posts

Posted 12 November 2010 - 03:38 AM

Most impressive indeed!

That last one looks like some kind of wierd alien wearing a crown.
I wonder if he lives in one of those buildings above it?

Don.

Understanding

• Members
• 1237 posts

Posted 12 November 2010 - 08:32 AM

Question: Why did you decide to use these criteria ?

victor= complex (1 , 2) sets the complex variable victor to 1 + 2i
bravo = complex (3 , 7) sets bravo = 3 + 7i

Did you try other possibilities ? And, why use "i" ?

### #7 Kharakov

Kharakov

Thinking

• Members
• 114 posts

Posted 12 November 2010 - 08:28 PM

Thanks Don, the whole fricken fractal is weird... I'm thinking its intricate structure could be used for gaming, especially using various julias as game worlds with complicated structures.

Rade- Complex numbers are pretty interesting, I'd check out the wikis on the Mandelbrot Set, and complex numbers, and imaginary numbers.

"i" signifies the imaginary unit.