Logo by stardust4ever - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. October 03, 2018, 09:26:13 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: No Title  (Read 329 times)
0 Members and 1 Guest are viewing this topic.
yv3
Conqueror
*******
Posts: 149



WWW
« on: October 09, 2011, 12:04:15 AM »



This is my personal approach to implement the Collatz conjecture into a mandelbrot fractal wink.

Code:
	
void yFractal::GetFractalColor64()
{
static double x, y, prev_x, prev_y;
static int n, i;

prev_x=m_CustomRange4;
prev_y=0.0;

for(n=0; n<m_Iterations; n++)
{
x=m_StartX + (prev_x*prev_x*1.0) - (prev_y*prev_y*1.0);
y=m_StartY + (prev_x*prev_y*2.0);

i=int(x*y);

if(i%2==0)
{
if(m_CustomRange2!=0.0)
{
x=x/m_CustomRange2;
y=y/m_CustomRange2;
}
}
else
{
x*=m_CustomRange3;
x+=m_CustomRange1;
y*=m_CustomRange3;
y+=m_CustomRange1;
}

if((x*x)+(y*y) < m_Magnitude )
{
prev_x=x;
prev_y=y;
}
else
{
m_C=int( float(n) * m_ColorPerIteration ); // Return color index from range 0 to (m_NumColors-1)
return;
}
}

m_C=0;
}

Made with yFract.


Logged

Creator of yFract
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
No title Images Showcase (Rate My Fractal) AGUS 1 457 Last post August 29, 2008, 02:48:51 AM
by Duncan C
No title Images Showcase (Rate My Fractal) AGUS 0 303 Last post August 28, 2008, 07:28:57 PM
by AGUS
No title Images Showcase (Rate My Fractal) AGUS 0 300 Last post August 28, 2008, 07:28:57 PM
by AGUS
NO TITLE UltraFractal Gallery AGUS 0 261 Last post July 18, 2009, 08:50:20 PM
by AGUS
NO TITLE UltraFractal Gallery AGUS 0 265 Last post July 18, 2009, 08:53:35 PM
by AGUS

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.156 seconds with 24 queries. (Pretty URLs adds 0.009s, 2q)