(http://yv3.bplaced.net/gallery/yFract/25921.jpg)
This is my personal approach to implement the Collatz conjecture into a julia fractal ;).
void yFractal::GetFractalColor66()
{
static double x, y, prev_x, prev_y;
static int n, i;
x=m_StartX;
y=m_StartY;
for(n=0; n<m_Iterations; n++)
{
prev_x=x;
prev_y=y;
x=(prev_x*prev_x) - (prev_y*prev_y) - m_CustomRange4;
y=(2.0 * prev_x * prev_y) + m_CustomRange2;
i=int(prev_x/prev_y);
if(i%2==0)
{
if(m_CustomRange2!=0.0)
{
x=x/1.4;
y=y/1.4;
}
}
else
{
x*=m_CustomRange3;
x+=m_CustomRange1;
y*=m_CustomRange3;
y+=m_CustomRange1;
}
if( ((x*x)+(y*y)) >= m_Magnitude )
{
m_C=int( float(n) * m_ColorPerIteration ); // Return color index from range 0 to (m_NumColors-1)
return;
}
}
m_C=0;
}
Made with yFract (http://yv3.bplaced.net/forum/index.php?topic=53.0).