View Single Post

Blog Entries: 1

## Continuity of real portion of cosine variant of 3d fractals

By continuity I mean an unbroken fractal. With certain variants, one ends up with sharp gaps in the fractal.

$$mag=({x^2+y^2+z^2})^{n/2}$$
$$yzmag=\sqrt{y^2+z^2}$$
$$\theta= n *atan2 \;\;(x + i\;\;yzmag )$$
$$\phi = n* atan2\;\; (y + iz)$$

$$new_x= \cos{(theta)}\;*\;mag$$
$$new_y= \sin{(theta)}\;*\;\cos{(phi)}\;*\;mag$$
$$new_z= \sin{(theta)}\;*\;\sin{(phi)}\;*\;mag$$

You can add in pixel components for the Mandelbrot variant, starting with a seed value; or you can start with a pixel value and add in Julia components for the Julia variant (same as with normal 2d Mandelbrots).

There are various modifications that make this formula produce nicer fractals- taking the negative absolute value of the sin(theta) component in the new y and z components makes a much more interesting fractal.

What I am interested in is this:

When n=2 you can do the following manipulation and the fractal remains continuous (is not fragmented).

if x> yzmag then new_x = -new_x

If n= anything other than 2+4*V (with V=0,1,2,3....) the fractal will become fragmented. In other words, the above formula only works for n=2,6,10,14.....

When n is odd (n=3,5,7,9....) you can do the following manipulation of the new x component and not have a fragmented fractal:

if x>0 then new_x = -new_x

These 2 manipulations work for multiple fractal formulas- I've tested them on my mag vs. xyz variety with great results, but I'd like to write a CONTINUOUS general formula to calculate the following function:

var(n,yzmag) equals yzmag for n=2,6,10 equals 0 for n=3,5,7 and is between yzmag and 0 when between 1 and 3 or between 5 and 7...

So that I can write a general formula like:

if x > var(n,yzmag) then new_x=-new_x

Now yzmag might be better written (for between 3 and 5... as 4,8,12, etc. don't do continuous fractals even for -yzmag) as:

$$yzmag = |y|*y \;+\;|z|*z$$

if (yzmag>0) $yzmag=\sqrt{|yzmag|}$
else $yzmag=-\sqrt{|yzmag|}$

note that this will result in entirely differently shaped fractals (works well in some cases... not in others).

Anyways, anyone with a particular grasp of this field of mathematics might know the answer- what equation do we use to determine what portion of yzmag to use? Looks like it might be cosine or sin type thing, or perhaps some relation between (theta and pi) * yzmag.