Logo by lycium - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. November 20, 2025, 04:01:08 AM


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 827 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 1304 Last post August 29, 2008, 02:48:51 AM
by Duncan C
No title Images Showcase (Rate My Fractal) AGUS 0 1353 Last post August 28, 2008, 07:26:30 PM
by AGUS
No title Images Showcase (Rate My Fractal) AGUS 1 1526 Last post August 29, 2008, 01:36:53 AM
by _db_
No title Images Showcase (Rate My Fractal) AGUS 0 1282 Last post August 28, 2008, 07:26:31 PM
by AGUS
No title Images Showcase (Rate My Fractal) AGUS 0 1592 Last post August 28, 2008, 07:26:31 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.347 seconds with 24 queries. (Pretty URLs adds 0.009s, 2q)