. HOME
 
. Features
. Gallery
. Download
. Documentation
 
. Resources
. Mailing Lists
. Programs
. Feature Voting
. Wishlist
 
. Theory
. Tutorials
 
. Formula DB
 
. Contact
CHAOSPRO 3.2
Release 4.0
.

ChaosPro Formula Database

  
NameNumberSeekerColouring.ccl
Path/Compiler/MalinovskyFract/
TypeColoring
Size63 KB
OwnerEdgar Malinovsky
Last Modified:24 Sep 2014
  


NumberSeeker {
// By Edgars Malinovskis 20.12.2011
// -Z seeker marks respective negative escaping z values with dots (zeros)
// around 2D mandelbrots and on 3D mandelbulb 
// Colours positive and negative quaternion hemispheres differently
// Colour method based on Exponenthial Smoothing developed by Ron Barnett code from Damien M. Jones,
// and simple orbit colouring for quaternions. Zoom requires iteration increase.
// Good with mandel bulbs and brots but not so with sophisticated formulas.

real sum;
real sum2;
real cabsz;
complex zold;
parameter bool diverge;
parameter bool converge;
parameter bool modulusz;
parameter complex posneg;
parameter int iternum;
int cnt, iIter;

void init_once(void)
	{
		iIter=iternum;
		if (iIter>=maxiter)
		{
			iIter=maxiter-1;
		}
	}

	void init(void)
	{
		sum= sum2= 0.0;
		zold= (0,0);
		cabsz= 0;
		cnt=0;
	}
	void loop(void)
	{
	 
if (cnt <= iIter) //calculates colours just of first iterations
{
		if  (diverge)
		{
			sum= sum+ exp(-cabs(z+posneg));
		}
		if  (converge)
		{
			sum2= sum2+ exp(-1/cabs(zold-z+posneg));
		}
		zold= z;
		cnt=cnt+1;
				if (modulusz)  // if nothing works this gives result
				{
				cabsz= cabs(z+posneg);
				}
}
	}
	void final(void)
	{
		if  (|z- zold| < 0.5)  // bounded
		{
			if  (converge)
			{
				index= sum2;
			}
			else
			{
				index= cabsz;
			}
    
		}
		else
		{
			// to infinity
			if  (diverge)
			{
				index= sum;
			}
			else
			{

				 index= cabsz;
			}
		}
	}
	void description(void)
	{
		this.title = "NumberSeeker";
		this.helpfile="http://www.fractalforums.com/the-3d-mandelbulb/more-natural-mandelbulb-surfaces/msg39296/";
 
		diverge.caption = "Exp Smooth toInfinity";
		diverge.default =  true;
		diverge.hint = "If set, points which escape to infinity will be colored.";
 
		converge.caption = "Exp Smooth toBounded";
		converge.default =  true;
		converge.hint = "If set, points which collapse to set will be colored.";
		
		modulusz.caption = "Colouring by modulus of Z";
		modulusz.default =  true;
		modulusz.hint = "Use simple modulusZ method";
 
		posneg.caption = "-Z Seeker (r,i)";
		posneg.default =  (2.0, 0.0);
		posneg.hint = "Adding number diverses negative Z areas";
		
		iternum.caption="Use first N iterations";
		iternum.default=30;
		iternum.min=0;
		iternum.hint="Lets you specify the iteration cycle at which you want to apply coloring";
	}
}


TwinLamps {
// Exponential smoothing (Ron Barnet coded by Damien M. Jones) divided by fractal dimension statistics (from Kerry Mitchell). 
// + 2 detail leveling functions in both methods for smoother picture. 
// Tried to make algorithm as universal as possible and 
// showing features of fractal and not of colour algorithm.
// Goes nicely with mandelbrots, bulbs, patterns, quaternions and julias,
// but not with newton fractals and mandelboxes.
// Zoom in requires manual increase of colour iterations.

// by Edgar Malinovsky 13.01.2012
//You may redistribute this algorithm, modify, derivate or use comercialy as you wish as long as you give proper credits.

real sum;
real cabsz, lnz;
real zmax, zmin;
parameter int dimtype;
parameter complex posneg;
parameter int iternum;
parameter int tanhsmooth;
int cnt, iIter;

void init_once(void)
	{
		iIter=iternum;
		if (iIter>=maxiter)
		{
			iIter=maxiter-1;
		}
	}

	void init(void)
	{
		sum= 0.0;
		cabsz=0;
		zmin=1e20;
		zmax=-1;
		cnt=0;
	}
	void loop(void)
	{
	 
if (cnt <= iIter) //calculates first iterations
{
cabsz= cabs(z+posneg);

	if (dimtype=="Exp- leveled |z|")
	{
	lnz=exp(-cabsz);
	}
	else if (dimtype=="Ln leveled |z|")
	{
	lnz=ln(cabsz);
	}
	else
	{
	lnz=cabsz;
	}

//finding min and max z.
if (lnz < zmin)
{
zmin = lnz;
}
if (lnz > zmax)
{
zmax = lnz;
}
		//exp smoothing
		sum= sum+ exp(-cabsz);
		cnt=cnt+1;
}
	}

	void final(void)
	{
if (tanhsmooth == "TanH leveled")
{		
index=tanh(sum)/(1+zmax-zmin);
}

else if (tanhsmooth == "Sqrt leveled")
{
index=sqrt(sum)/(1+zmax-zmin);
}

else if (tanhsmooth == "Non leveled")
{
index=sum/(1+zmax-zmin);
}
	}

	void description(void)
	{
		this.title = "TwinLamps";

		posneg.caption = "Add to pixel value";
		posneg.default =  (0.0, 0.0);
		posneg.hint = "Adding number diverses negative Z areas from positive";
		
		iternum.caption="Use first N iterations";
		iternum.default=150;
		iternum.min=0;
		iternum.hint="Specifies first iterations at which coloring is applied";
		
		dimtype.caption = "Fractal Dimension of";
		dimtype.enum = "Exp- leveled |z|\nLn leveled |z|\n|z|";
		dimtype.default = 0;
		
		tanhsmooth.caption = "Exp- smoothing is";
		tanhsmooth.enum = "Sqrt leveled\nTanH leveled\nNon leveled";
		tanhsmooth.default =  0; 
	}
}





TwinLampsDir {
// Direct colouring Twin Lamps method.
// Exponential smoothing colouring divided by fractal dimenison statistics. 
// + an option to use sole Direct Colouring Exponent Smoothing.

// Red green and blue colour values are calculated
// by different exponent (smoothing) bases.
// It gives cosmic looks as alike algorithm
// are used to colour astronomic photographies.
// The larger are base, the less of that colour. Just keep numbers different (real, imaginary, real negative)
// 3x as slow and unwielding as palette based version;)

// + Changed exponent bases to generate more natural colours. 31.03.2012.

// 20.04.2012.
// + normalisation for z values converging to small number, aka all white insides.
// +  post functions for more colour capabilities. 
// Saved fractals of older versions could require maxiter increase or will be darker.

// + post functions for greater variety.
// + switch to use pallete, index is green channel.
// 03.10.2012. + new colour mode - harmonic between gradient and direct.
// 12.10.2012. + colour modes: 
// Pallete with index calculated as harmonic mean between 3 chanells - smoother.
// Fractal Explorer like using pallete, but calculating chanells seperately - more control than direct.
// 13.11.2012. + flag to remove unnatural blue tones in direct modes.
// 14.08.2013. + triangle transfer function and more colour switches.

// by Edgars Malinovskis 20.01.2012.
//You may redistribute this algorithm, modify, derivate or use comercialy as you wish as long as you give proper credits.

complex sumR, sumG, sumB;
real cabsz, lnz, resultR, resultG, resultB, tempR, tempG, tempB, resultAlpha;
real zmax, zmin;
parameter int dimtype;
parameter complex posneg;
parameter int iternum, tanhsmooth, postfn;
int cnt, iIter;
parameter bool justexp, switchRG, switchRB, pallete, naturalise;
parameter complex baseR, baseG, baseB;
color gradcolor; 

void init_once(void)
	{
		iIter=iternum;
		if (iIter>=maxiter)
		{
			iIter=maxiter-1;
		}
	}

	void init(void)
	{
		sumR=sumG=sumB=(0, 0);
		cabsz =0;
		zmin=1e20;
		zmax=-1;
		cnt=0;
	}
	void loop(void)
	{
	 
if (cnt <= iIter) //calculates first iterations
{
cabsz= cabs(z+posneg);

	if (justexp == false)
	{
	if (dimtype=="Exp- leveled |z|")
	{
	lnz=exp(-cabsz);
	}
	else if (dimtype=="Ln leveled |z|")
	{
	lnz=ln(cabsz);
	}
	else
	{
	lnz=cabsz;
	}

	//finding minimal and maximal z values
	if (lnz < zmin)
	{
	zmin = lnz;
	}
	if (lnz > zmax)
	{
	zmax = lnz;
	}
	}
			
// normalisation for the insides
// effect are noticable with iterations close to max and small z value.
cabsz = cnt/iIter*2 + cabsz;

cnt=cnt+1;
		//exp smoothing. with different z different exponent bases gives different summs for each chanell.
		sumR=  baseR^(-cabsz) + sumR;
		sumG=  baseG^(-cabsz) + sumG;
		sumB=  baseB^(-cabsz) + sumB;
}
	}
	void final(void)
	{
	//to diverse negative bases, take just real part of summ
	resultR=abs(real(sumR));
	resultG=abs(real(sumG));
	resultB=abs(real(sumB));
	
	
if (tanhsmooth == "TanH leveled" && justexp == false)
{		
resultR=tanh(resultR)/(1+zmax-zmin);	
resultG=tanh(resultG)/(1+zmax-zmin);
resultB=tanh(resultB)/(1+zmax-zmin);
}

else if (tanhsmooth == "Sqrt leveled" && justexp == false)
{
resultR=sqrt(resultR)/(1+zmax-zmin);	
resultG=sqrt(resultG)/(1+zmax-zmin);
resultB=sqrt(resultB)/(1+zmax-zmin);
}

else if (tanhsmooth == "Non leveled" && justexp == false)
{
resultR=resultR/(1+zmax-zmin);	
resultG=resultG/(1+zmax-zmin);
resultB=resultB/(1+zmax-zmin);
}

else if (justexp == true)
{ // Direct colouring exponent smoothing
resultR=resultR;	
resultG=resultG;
resultB=resultB;
}

//modifications of index grade values 0 to 1.
if (postfn==0)	
{
	resultR=resultR;
	resultG=resultG;
	resultB=resultB;
}
else if (postfn==1)	
{
	resultR=sqr(resultR);
	resultG=sqr(resultG);
	resultB=sqr(resultB);
}

else if (postfn==2)	
{
	resultR=sqrt(resultR);
	resultG=sqrt(resultG);
	resultB=sqrt(resultB);
}

else if (postfn==3)	
{
	resultR=1-(resultR);
	resultG=1-(resultG);
	resultB=1-(resultB);
}

else if (postfn==4)	
{
resultR=cos(pi*resultR)+resultR*0.5;
resultG=cos(pi*resultG)+resultG*0.5;
resultB=cos(pi*resultB)+resultB*0.5;
}	
	
else if (postfn==5)	
{
tempR= resultR;
tempG= resultG;
tempB= resultB;
	resultR= abs(tempR -sqrt(tempG*tempB)*0.5);
	resultG= abs(tempG -sqrt(tempR*tempB)*0.5);
	resultB= abs(tempB -sqrt(tempR*tempG)*0.5);
}

else if (postfn==6)	
{
	resultR=sqr(sin(pi*resultR));
	resultG=sqr(sin(pi*resultG));
	resultB=sqr(sin(pi*resultB));
}

else if (postfn==7)	
{
	resultR=sin(resultR);
	resultG=sin(resultG);
	resultB=sin(resultB);
}

else if (postfn==8)	
{
resultR= abs( resultR -round(resultR) );
resultG= abs( resultG -round(resultG) );
resultB= abs( resultB -round(resultB) );
}

else if (postfn==9)	
{
resultR=tanh(resultR);
resultG=tanh(resultG);
resultB=tanh(resultB);
}

		else if  (postfn==10)
		{
			resultR=sin((resultR) )*cos((resultG));
			resultG=sin((resultG) )*cos((resultR));
			resultB=sin((resultB) )*cos((resultR));

		}
		else if  (postfn==11)
		{
			resultR=((resultR)/(2+abs(resultR)))*3;
			resultG=((resultG)/(2+abs(resultG)))*3;
			resultB=((resultB)/(2+abs(resultB)))*3;

		}
		else if  (postfn==12)
		{
			resultR=abs(abs(resultR*0.5-trunc(resultR*0.5))-0.5)*2;
			resultG=abs(abs(resultG*0.5-trunc(resultG*0.5))-0.5)*2;
			resultB=abs(abs(resultB*0.5-trunc(resultB*0.5))-0.5)*2;
  	 	
		}

	// switching red and blue.
	if  (switchRB==true)
	{
		cabsz=resultB;
		resultB=resultR;
		resultR=cabsz;
	}
	//switching red and blue.
	if (switchRG == true)
	{
	cabsz=resultG;
	resultG=resultR;
	resultR=cabsz;
	}

//colour mode: direct, using palette, or mix.
if (pallete==0)
{

			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}

	pixelcolor = rgb(resultR, resultG, resultB);
}
else if (pallete==1)
{
index=resultG;
}
	else if (pallete==2)
	{
	 //gradient is by arithmetic mean of RGB
	gradcolor=gradient( (resultR+resultG+resultB)*0.333333333333333 );
	//harmonic of gradient and RGB	
	resultR=2/( recip(red(gradcolor))+recip(resultR)  );
	resultG=2/( recip(green(gradcolor)) + recip(resultG)  );
	resultB=2/( recip(blue(gradcolor)) + recip(resultB)  );
	resultAlpha=alpha(gradcolor);
	
			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}	
	
	pixelcolor = rgba(resultR, resultG, resultB,resultAlpha);
	}
else if (pallete==3)
{
// colour mode like of Fractal Explorer.
// uses pallete, but each chanell is calculated seperately.
resultR=red(gradient(resultR));
resultG=green(gradient(resultG));
resultB=blue(gradient(resultB));
resultAlpha=alpha(gradient( resultG));

			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}

pixelcolor = rgba(resultR, resultG, resultB, resultAlpha);
}
else if (pallete==4)
{
index=3/(recip(resultR) + recip(resultG) + recip(resultB) ) ;
}

	}
	void description(void)
	{
		this.title = "TwinLamps Direct Colouring";
		this.helpfile="http://www.fractalforums.com/index.php?topic=10153.0";

		separator.label2.caption  = "For Gradient change the colour mode";
		
		pallete.caption = "Colour Mode";
		pallete.enum = "Direct Colouring \nPallete Based (by green channel)\nMixed Harmonic\nFractal Explorer like\nPallete by harmonic mean";
		pallete.default=2;

		posneg.caption = "Add to pixel value";
		posneg.default =  (1.0, 0);
		posneg.hint = "Adding number diverses negative Z areas";
		
		iternum.caption="Use first N iterations";
		iternum.default=2500;
		iternum.min=0;
		iternum.hint="Specifies iterations at which coloring is applied";

		dimtype.caption = "Fractal Dimension of";
		dimtype.enum = "Exp- leveled |z|\nLn leveled |z|\n|z|";
		dimtype.default = 0;
		dimtype.visible = (justexp == false);
		
		tanhsmooth.caption = "Exp smooth is";
		tanhsmooth.enum = "Sqrt leveled\nTanH leveled\nNon leveled";
		tanhsmooth.default =  0; 
		tanhsmooth.visible = (justexp == false);
		
		justexp.caption = "Just direct Exp Smoothing";
		justexp.default=true;
	
		postfn.caption = "Transfer Function";
		postfn.enum = "1- None\n2- Square Power (darker)\n3- Square Root (lighter)\n4- Inverted\n5- Half Periodic cos\n6- Accentuate RGB\n7- Haversine\n8- periodic Sine\n9- Solarisation\n10- Hyperbolic Tangent\n11- SineCosineMix\n12- Sigmoid\n13- Triangle";
		postfn.default =  0; 
 
		switchRB.caption = "Switch Red and Blue";
		switchRB.default= false;
 		
		switchRG.caption = "Switch Red and Green";
		switchRG.default=false;		
		
		naturalise.caption = "Naturalise Colours (remove blue tint)";
		naturalise.default= false; 
		naturalise.visible =  (pallete== 0||pallete== 2||pallete== 3);				
		
		baseR.caption = "Red Base";
		baseR.default = (3.0,0);
		baseR.hint="Base for red channel exponent. The more different bases, the more different colours. Larger values results less of that colour.";
		baseG.caption = "Green Base";
		baseG.default = (-1.85,0);
		baseB.caption = "Blue Base";
		baseB.default = (0,1.85);
	}
}


LogTrichrome {

// Direct colour method based on Fractal Explorer and NASA
// colour techniques. Summs of inveversed multiple log,
// algorithm by Arthur Sirotinsky and Olga Federenko. 
// Colour information is generated by each channel having
// different logarithm bases.

// + post functions for greater variety.
// + switch to use pallete, index is green channel.
// 03.10.2012. + new colour mode - harmonic between gradient and direct.
// So to have advantages of both.
// 12.10.2012. + colour modes: 
// Pallete with index calculated as harmonic mean between 3 chanells - smoother.
// Fractal Explorer like using pallete, but calculating chanells seperately - more control than direct.
// 17.10.2012. better normalisation for deeper renders.
// 13.11.2012. + flag to remove unnatural blue tones in direct modes.
// 14.08.2013. + triangle transfer function & more colour switches.
// 28.08.2013 + Pre functions, works like orbit traps.

// 30.09.2013  + 8 pre functions.
//+ random noise taken from Mark Townsend's scripts.

// by Edgar Malinovsky 16.04.2012.
// You may redistribute this algorithm, modify, derivate or use comercialy as you wish as long as you give proper credits.

real sumR, sumG, sumB, cabsz, resultR, resultG, resultB, resultAlpha;
parameter int lgtype, postfn, pallete, prefn;
parameter complex posneg;
int cnt, normaliter;
parameter real baseR, baseG, baseB, darkness;
real factlogR, factlogG, factlogB, dataR, dataG, dataB;
parameter bool switchRB, naturalise, switchRG;
color gradcolor; 
complex ztemp;
parameter bool userandom;
parameter float hyperandom;
 
	void init(void)
	{
		sumR= sumG= sumB=(0, 0);
		cnt=0;
		
//Calculating differences to ln
factlogR = recip(log(baseR));
factlogG = recip(log(baseG));
factlogB = recip(log(baseB));
		

	}
	void loop(void)
	{

		//"trap center". auto convert to complex.
		ztemp=z+posneg;
		//pre functions
		// + 1.0E-15 to avoid null value dots and not working with magnet.

		if  (prefn== 0)  // original unmodified
		{
			cabsz= cabs( ztemp+1.0E-15);
		}
		else if  (prefn== 1)
		{
			cabsz= cabs( real(ztemp)- imag(ztemp) +1.0E-15);
		}
		else if  (prefn== 2)
		{
			cabsz= cabs( real(ztemp)* imag(ztemp) +1.0E-15);
		}
		else if  (prefn== 3)
		{
			cabsz= cabs( real(ztemp)% (imag(ztemp) +1E-20) +1.0E-15);
		}
		else if  (prefn== 4)
		{
			cabsz= |ztemp+1.0E-15|;
		}  // non linear
		else if  (prefn== 5)
		{
			cabsz= cabs( abs(real(ztemp)*2+ imag(ztemp))+ recip(abs(ztemp)+1e-15) +1.0E-15);
		}
		else if  (prefn== 6)
		{
			cabsz= cabs( ( (real(ztemp))*2+ (imag(ztemp))/((real(ztemp))+ (imag(ztemp))+ (1.9,0.1) )  ) +1.0E-15);
		}
		else if  (prefn== 7)
		{
			cabsz= cabs( (round(ztemp) +ztemp)*0.5 +1.0E-15);
		}
		else if  (prefn== 8)
		{
			cabsz= cabs( sinh( ztemp)  +1.0E-15);
		}
		else if  (prefn== 9)
		{
			cabsz= cabs( cos( ztemp)  +1.0E-15);
		}  // symmetric
		else if  (prefn== 10)
		{
			cabsz=cabs( complex( sqr(imag(ztemp)) - sqrt(abs(real(ztemp))) ,  sqr(real(ztemp)) - sqrt(abs(imag(ztemp) )) ) + 1.0E-15);
		}
		else if  (prefn== 11)
		{
			cabsz= cabs(( sqr(sqr( imag(ztemp) )) + sqr(sqr( real(ztemp) )) + 1.0E-15  ) ^0.25 );
		}
		else if  (prefn== 12)  // real
		{
			cabsz= abs(real( ztemp+1.0E-15));
		}
		else if  (prefn== 13)  // imag
		{
			cabsz= abs(imag( ztemp)  +1.0E-15);
			//from orbit trap	
		}
		else if  (prefn== 14)
		{
			// "hyperbola"
			cabsz= abs(imag(ztemp) * real(ztemp) - 1+1.0E-15);
			// from thin orbit trap of Samuel Monnier
		}
		else if  (prefn== 15 )
		{
			//sincos waves
			cabsz= abs( sin(real(ztemp)) + cos(real(ztemp)) + imag(ztemp) +1.0E-15 );
		}
		else if  (prefn== 16 )
		{
			//parabola
			cabsz= abs( sqr(real(ztemp)) - imag(ztemp) +1.0E-15);
		}
		else if  (prefn== 17 )
		{
			//trifolium
			cabsz= abs(8/( sqr(real (ztemp) )  +4) - imag(ztemp) +1.0E-15);
			//arlecchino, modified Mark Townsend harlequin
		}
		else if  (prefn== 18 )
		{
			//arlecchino
			cabsz=cabs( ztemp- 1- sqr(1.25*real(atan( real(ztemp) / (imag(ztemp)+1.0E-15 ) )) )   +1.0E-15);
			//formulas
		}
		else if  (prefn== 19)
		{
			//Chebyshev4Axolotl
			cabsz=cabs(  (sqr(ztemp)*(35 * sqr(ztemp) - 30) + 3) / 8  +1.0E-15);
		}



cnt=cnt+1;

	//Log normalisation for insides => zero.
	if (cnt<100)
	{
	normaliter =sqr(cnt);
	}
	
//Here goes logarithms
if (lgtype ==0)
{
dataR=  abs( factlogR*log (  factlogR*log (  factlogR*log (cabsz)  )  ) );
dataG=  abs( factlogG*log (  factlogG*log (  factlogG*log (cabsz)  )  ) );
dataB=  abs( factlogB*log (  factlogB*log (  factlogB*log (cabsz)  )  ) );
}	

else if (lgtype ==1)
{
dataR=  abs( factlogR*log (  log (  factlogR*log (cabsz)  )  ) );
dataG=  abs( factlogG*log (  log (  factlogG*log (cabsz)  )  ) );
dataB=  abs( factlogB*log (  log (  factlogB*log (cabsz)  )  ) );
}	

else if (lgtype ==2)
{
dataR=  abs( factlogR*log (  factlogR*log (  factlogR*log (  factlogR*log (cabsz)  )  )  ) );
dataG=  abs( factlogG*log (  factlogG*log (  factlogG*log (  factlogG*log (cabsz)  )  )  ) );
dataB=  abs( factlogB*log (  factlogB*log (  factlogB*log (  factlogB*log (cabsz)  )  )  ) );
}			

else if (lgtype ==3)
{

dataR=  abs( factlogR*log (  ( factlogR*log (cabsz ) )  ) );
dataG=  abs( factlogG*log (  ( factlogG*log (cabsz ) )  ) );
dataB=  abs( factlogB*log (  ( factlogB*log (cabsz ) )  ) );
}

		//summ of inverted.
		sumR= recip(dataR*normaliter +  darkness) + sumR;
		sumG= recip(dataG*normaliter +  darkness) + sumG;
		sumB= recip(dataB*normaliter +  darkness) + sumB;

	}
	void final(void)
	{
	
		if  (userandom==true)
		{
			sumR= abs( tanh(hyperandom*real(random)) +sumR);
			sumG= abs( tanh(hyperandom*real(random)) +sumG);
			sumB= abs( tanh(hyperandom*real(random)) +sumB);
		}	
	
//modifications of index grade values 0 to 1.
if (postfn==0)	
{
	resultR=sumR;
	resultG=sumG;
	resultB=sumB;
}
else if (postfn==1)	
{
	resultR=sqr(sumR);
	resultG=sqr(sumG);
	resultB=sqr(sumB);
}

else if (postfn==2)	
{
	resultR=sqrt(sumR);
	resultG=sqrt(sumG);
	resultB=sqrt(sumB);
}

else if (postfn==3)	
{
	resultR=1-(sumR);
	resultG=1-(sumG);
	resultB=1-(sumB);
}

else if (postfn==4)	
{
resultR=cos(pi*sumR)+sumR*0.5;
resultG=cos(pi*sumG)+sumG*0.5;
resultB=cos(pi*sumB)+sumB*0.5;
}	
	
else if (postfn==5)	
{
	resultR=abs(sumR -sqrt(sumG*sumB)*0.5);
	resultG=abs(sumG -sqrt(sumR*sumB)*0.5);
	resultB=abs(sumB -sqrt(sumR*sumG)*0.5);
}

else if (postfn==6)	
{
	resultR=sqr(sin(pi*sumR));
	resultG=sqr(sin(pi*sumG));
	resultB=sqr(sin(pi*sumB));
}

else if (postfn==7)	
{
resultR= abs( sumR -round(sumR) );
resultG= abs( sumG -round(sumG) );
resultB= abs( sumB -round(sumB) );
}

else if (postfn==8)	
{
resultR=tanh(sumR);
resultG=tanh(sumG);
resultB=tanh(sumB);
}

		else if  (postfn==9)
		{
			resultR=sin((sumR) )*cos((sumG));
			resultG=sin((sumG) )*cos((sumR));
			resultB=sin((sumB) )*cos((sumR));

		}
		else if  (postfn==10)
		{
			resultR=((sumR)/(2+abs(sumR)))*3;
			resultG=((sumG)/(2+abs(sumG)))*3;
			resultB=((sumB)/(2+abs(sumB)))*3;

		}
		
		else if  (postfn==11)
		{
			resultR=abs(abs(sumR*0.5-trunc(sumR*0.5))-0.5)*2;
			resultG=abs(abs(sumG*0.5-trunc(sumG*0.5))-0.5)*2;
			resultB=abs(abs(sumB*0.5-trunc(sumB*0.5))-0.5)*2;

		}		
		
	//switching red and blue.
	if (switchRB == true)
	{
	sumB=resultB;
	resultB=resultR;
	resultR=sumB;
	}
	// switching red and green.
	if  (switchRG==true)
	{
		sumB=resultG;
		resultG=resultR;
		resultR=sumB;
	}

//colour mode: direct, using palette, or mix.
if (pallete==0)
{

			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}			

	pixelcolor = rgb(resultR, resultG, resultB);
}
else if (pallete==1)
{
index=resultG;
}
	else if (pallete==2)
	{
	 //gradient is by arithmetic mean of RGB
	gradcolor=gradient( (resultR+resultG+resultB)*0.333333333333333 );
	//harmonic of gradient and RGB	
	resultR=2/( recip(red(gradcolor))+recip(resultR)  );
	resultG=2/( recip(green(gradcolor)) + recip(resultG)  );
	resultB=2/( recip(blue(gradcolor)) + recip(resultB)  );
	resultAlpha=alpha(gradcolor);
	
			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}				
	
	pixelcolor = rgba(resultR, resultG, resultB,resultAlpha);
	}
else if (pallete==3)
{
// colour mode like of Fractal Explorer.
// uses pallete, but each chanell is calculated seperately.
resultR=red(gradient(resultR));
resultG=green(gradient(resultG));
resultB=blue(gradient(resultB));
resultAlpha=alpha(gradient( resultG));

			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}			

pixelcolor = rgba(resultR, resultG, resultB, resultAlpha);
}
else if (pallete==4)
{
index=3/(recip(resultR) + recip(resultG) + recip(resultB) ) ;
}
	}
	void description(void)
	{
		this.title = "Log Trichrome";
		this.helpfile="http://www.fractalforums.com/index.php?topic=11520";

		separator.label2.caption  = "For Gradient change the colour mode";

		pallete.caption = "Colour Mode";
		pallete.enum = "Direct Colouring \nPallete Based (by green channel)\nMixed Harmonic\nFractal Explorer like\nPallete by harmonic mean";
		pallete.default=0;

		posneg.caption = "Add to pixel value";
		posneg.default =  (0, 0);
		posneg.hint = "Adding number aka trap center curves stalks around points with the opposite value. (2 and -2) And diverses + and - areas.";		
		
		lgtype.caption = "Logarithms applied";
		lgtype.enum = "1- Triple logarithm\n2- Smoother Triple log\n3- Quadruple logarithm\n4- Double logarithm";
		lgtype.default = 0;
		
		darkness.caption="Darkness amount";
		darkness.default=2.5;
		darkness.hint="Value added before inverting logarithm. Larger value creates darker pictures.";				
		
		switchRB.caption = "Switch Red and Blue";
		switchRB.default=false;		
		
		switchRG.caption = "Switch Red and Green";
		switchRG.default= false;			
		
		prefn.caption = "Pre Function";
		prefn.enum = "1 None\n2 X-Y\n3 X*Y\n4 remainder of X/Y\n5 X*X+Y*Y\n6 Stalks A\n7 Stalks B\n8 Areas\n9 Sinh\n10 Cos\n11 SZA Butterfly\n12 Supermodulus 4\n13 Real\n14 Imag\n15 Hyperbola\n16 Sincos Waves\n17 Parabola\n18 Trifolium\n19 Arlecchino\n20 Chebyshev4Axolotl";
		prefn.default =   0;
		prefn.hint= "Pre function applied before colour calculations. Changes colour pattern like orbit traps.";		
		
		postfn.caption = "Transfer Function";
		postfn.enum = "1- None\n2- Square Power (darker)\n3- Square Root (lighter)\n4- Inverted\n5- Half Periodic cos\n6- Accentuate RGB\n7- Haversine\n8- Solarisation\n9- Hyperbolic Tangent\n10- SineCosineMix\n11- Sigmoid\n12- Triangle";
		postfn.default =  0; 
		
		naturalise.caption = "Naturalise Colours (remove blue tint)";
		naturalise.default= false;	
		naturalise.visible =  (pallete== 0||pallete== 2||pallete== 3);

		userandom.caption = "Add Random noise";
		userandom.default =  false;
 
		hyperandom.caption = "Hypertangent noise";
		hyperandom.hint = "Adds a random noise to the colours. Use very small or very large values 0.1 or 50.";
		hyperandom.default =  0.04;
		hyperandom.visible =  (userandom==true);

		separator.label3.caption  = "Increase bailout > 50.";
		separator.label4.caption  = "Colours are calculated by log Bases:";   

		baseR.caption = "Red log Base";
		baseR.default = 1.35;
		baseR.hint="Logarithmic base for a red chanell. Colours are generated by each channel having different logs.";
		baseG.caption = "Green log Base";
		baseG.default = 1.55;
		baseB.caption = "Blue log Base";
		baseB.default = 1.65;	
	}
}


E++ExpSmoothting {
// by Edgar Malinovsky
// based on bunch of different ideas from REB, LDM and LKM to Fractal Explorer and my own.
// 17.07.2012.
// 15.08.2013. more transfer functions.
// 24.08.2013. +5 pre functions.
// 28.08.2013 +2 pre functions, now add to pixel should work correctly with pre functions.
// 30.09.2013  + 8 pre functions and random noise texturing
// taken from Mark Townsend's scripts.

int iter, cnt;
parameter int iternum;
complex imagine, minuse, sum, ztemp;
real result, zmax, cabsz, lnz, oldcabsz, data; 
parameter int prefn;
parameter complex posneg;
parameter bool expdim;
parameter int calculation;
parameter real darkness;
parameter int exponentype;
parameter complex base;
parameter int postfn;
parameter bool pallete;
parameter bool userandom;
parameter float hyperandom;

	void init_once(void)
	{
		iter=iternum;
		if  (iter>= maxiter)
		{
			iter=maxiter- 1;
		}

		imagine= e*(0,1);
		minuse= - e;
	}
	void init(void)
	{
		sum= (0, 0);
		zmax=-1;
		cnt=0;
		oldcabsz= 0.0;
	}
	void loop(void)
	{
		if  (cnt<= iter)  //calculates first iterations
		{

			//"trap center". auto convert to complex.
			ztemp=z+posneg;
			//pre functions
			// + 1.0E-15 to avoid null value dots and not working with magnet.
		if  (prefn== 0)  // original unmodified
		{
			cabsz= cabs( ztemp+1.0E-15);
		}
		else if  (prefn== 1)
		{
			cabsz= cabs( real(ztemp)- imag(ztemp) +1.0E-15);
		}
		else if  (prefn== 2)
		{
			cabsz= cabs( real(ztemp)* imag(ztemp) +1.0E-15);
		}
		else if  (prefn== 3)
		{
			cabsz= cabs( real(ztemp)% (imag(ztemp) +1E-20) +1.0E-15);
		}
		else if  (prefn== 4)
		{
			cabsz= |ztemp+1.0E-15|;
		}  // non linear
		else if  (prefn== 5)
		{
			cabsz= cabs( abs(real(ztemp)*2+ imag(ztemp))+ recip(abs(ztemp)+1e-15) +1.0E-15);
		}
		else if  (prefn== 6)
		{
			cabsz= cabs( ( (real(ztemp))*2+ (imag(ztemp))/((real(ztemp))+ (imag(ztemp))+ (1.9,0.1) )  ) +1.0E-15);
		}
		else if  (prefn== 7)
		{
			cabsz= cabs( (round(ztemp) +ztemp)*0.5 +1.0E-15);
		}
		else if  (prefn== 8)
		{
			cabsz= cabs( sinh( ztemp)  +1.0E-15);
		}
		else if  (prefn== 9)
		{
			cabsz= cabs( cos( ztemp)  +1.0E-15);
		}  // symmetric
		else if  (prefn== 10)
		{
			cabsz=cabs( complex( sqr(imag(ztemp)) - sqrt(abs(real(ztemp))) ,  sqr(real(ztemp)) - sqrt(abs(imag(ztemp) )) ) + 1.0E-15);
		}
		else if  (prefn== 11)
		{
			cabsz= cabs(( sqr(sqr( imag(ztemp) )) + sqr(sqr( real(ztemp) )) + 1.0E-15  ) ^0.25 );
		}
			else if  (prefn== 12)  // real
			{
				cabsz= abs(real( ztemp+1.0E-15));
			}
			else if  (prefn== 13)  // imag
			{
				cabsz= abs(imag( ztemp)  +1.0E-15);
				//from orbit trap	
			}
			else if  (prefn== 14)
			{
				// "hyperbola"
				cabsz= abs(imag(ztemp) * real(ztemp) - 1+1.0E-15);
				// from thin orbit trap of Samuel Monnier
			}
			else if  (prefn== 15 )
			{
				//sincos waves
				cabsz= abs( sin(real(ztemp)) + cos(real(ztemp)) + imag(ztemp) +1.0E-15 );
			}
			else if  (prefn== 16 )
			{
				//parabola
				cabsz= abs( sqr(real(ztemp)) - imag(ztemp) +1.0E-15);
			}
			else if  (prefn== 17 )
			{
				//trifolium
				cabsz= abs(8/( sqr(real (ztemp) )  +4) - imag(ztemp) +1.0E-15);
				//harlequin
			}
			else if  (prefn== 18 )
			{
				//arlecchino, modified Mark Townsend harlequin.
				cabsz=cabs( ztemp- 1- sqr(1.25*real(atan( real(ztemp) / (imag(ztemp)+1.0E-15 ) )) )   +1.0E-15);
				//formulas
			}
			else if  (prefn== 19)
			{
				//Chebyshev4Axolotl
				cabsz=cabs(  (sqr(ztemp)*(35 * sqr(ztemp) - 30) + 3) / 8  +1.0E-15);
			}

			//finding max z.
			if  (expdim== true)
			{
				lnz=exp(-cabsz);
				if  (lnz> zmax)
				{
					zmax= lnz;
				}
			}

			// some normalisation for insides => small value.
			if  (calculation== 2)
			{
				cabsz=cnt/iter*0.25  + cabsz;
			}
			else
			{

				cabsz=cnt/iter+ cabsz;
			}

			cnt=cnt+1;

			//now smoothing and convergent/divergent or both.
			if  (calculation== 0)
			{
				data= -cabsz- darkness;
			}
			else if  (calculation== 1)
			{
				data= oldcabsz- cabsz- darkness;
			}
			else if  (calculation== 2)
			{
				data= -abs( recip(oldcabsz-cabsz)- cabsz) - darkness;
			}

			//summ of exponents
			if  (exponentype== "Eulers Number")
			{
				sum= exp(data) + sum;

			}
			else if  (exponentype== "Negative E")
			{
				sum= minuse^(data) + sum;

			}
			else if  (exponentype== "Imaginary E")
			{
				sum= (imagine)^(data) + sum;

			}
			else if  (exponentype== "Free exponent")
			{
				sum= base^(data) + sum;
			}

			oldcabsz= cabsz;

		}
	}
	void final(void)
	{
		//only real positive numbers are of use
		result=abs(real(sum));
		if  (expdim== true)
		{
			result=result/(1+ zmax);
		}

		if  (userandom==true)
		{
			result= abs( tanh(hyperandom*real(random)) +result);
		}

		if  (postfn==0)
		{
			//nothing
		}
		else if  (postfn==1)
		{
			result=cos(pi*result)+result*0.5;

		}
		else if  (postfn==2)
		{
			result=cos(result);

		}
		else if  (postfn==3)
		{
			result=sqr(sin(pi*result));
	
		}
		else if  (postfn==4)
		{
			result=sin(result);
	
		}
		else if  (postfn==5)
		{
			result=result*0.5 + 0.5/result;
	
		}
		else if  (postfn==6)
		{
			result=tanh(result);

		}
		else if  (postfn==7)
		{
			result= abs( result-round(result) );
	
		}
			else if  (postfn==8)
		{
			result=((result)/(2+abs(result)))*3;

		}
		else if  (postfn==9)
		{
			result=abs(abs(result*0.5-trunc(result*0.5))-0.5)*2;

		}	

		index=result;
	}
	void description(void)
	{
		this.title = "E++ExpSmoothting";
 
		posneg.caption = "Add to pixel value";
		posneg.default =   (0, 0);
		posneg.hint = "The same as trap center. Adding number diverses negative Z areas and marks -n with dots. Say 2 marks all pixels where z=-2 with dots (technicaly zeroes).";
 
		iternum.caption="Use first N iterations";
		iternum.default= 7770000;
		iternum.min=1;
		iternum.hint="Specify the iteration cycle at which colouring is applied. Using just few first iterations would make fractal much smoother.";
 
		expdim.caption = "Fractal dimension smoothing";
		expdim.default =  false;
		expdim.hint = "Divides colour value by max inverse exponent. Sometimes generates smoother result, with a kalisets can generate sharper patterns.";
  
		 separator.label2.caption  = "Trying to make more advanced version of exponent smoothing;)";
 
		darkness.caption = "Darkness (smooths)";
		darkness.default =  0.0;
		darkness.hint="Adds value to inverse exponent. Positive value decreases detail density, negative increases.";
 
		calculation.caption = "Formula type";
		calculation.enum = "Mandelbrot type\nNewton type\nMagnet type";
		calculation.default =   0;
		calculation.hint = "Uses different formulas originaly intended for different fractal types based on bailout options: convergent, divergent and both (magnet). Should work with both.";
 
		exponentype.caption = "Exponent Base";
		exponentype.enum = "Eulers Number\nNegative E\nImaginary E\nFree exponent";
		exponentype.default =   0;
		exponentype.hint = "Exponent base used to calculate colours. Normal exponent function is single curve thus generating smooth gradient. Negative and imaginary exponents are wave functions thus generating waved colour gradient. Non default exponents could cease to work in deep zooms.";
 
		base.caption = "Exponent Base";
		base.default =  (-2,2);
		base.hint="Base for inverse exponent. Negative and imaginary values works differently than real. The larger number the least would be colour density.";
		base.visible =  (exponentype== "free exponent");
 
 		separator.label3.caption  = "Changes patterns";
		  
		prefn.caption = "Pre Function";
		prefn.enum = "1 None\n2 X-Y\n3 X*Y\n4 remainder of X/Y\n5 X*X+Y*Y\n6 Stalks A\n7 Stalks B\n8 Areas\n9 Sinh\n10 Cos\n11 SZA Butterfly\n12 Supermodulus 4\n13 Real\n14 Imag\n15 Hyperbola\n16 Sincos Waves\n17 Parabola\n18 Trifolium\n19 Arlecchino\n20 Chebyshev4Axolotl";
		prefn.default =   0;
		prefn.hint= "Pre function applied before colour calculations. Strongly changes colour pattern.";
 
 		separator.label4.caption  = "Changes colours";

		postfn.caption = "Transfer Function";
		postfn.enum = "1- None\n2- Half Cosine\n3- Cosine\n4- Haversine\n5- Sine\n6- DoubleEdged\n7- Hyperbolic Tangent\n8- Solarisation\n9- Sigmoid\n10- Triangle";
		postfn.default =   0;
		postfn.hint= "The same as built in colour transfer, but with additional functions.";
		
		userandom.caption = "Add Random noise";
		userandom.default =  false;
 
		hyperandom.caption = "Hypertangent noise";
		hyperandom.hint = "Adds a random noise to the colours. Use very small or very large values 0.1 or 50.";
		hyperandom.default =  0.04;
		hyperandom.visible =  (userandom==true);
	}
}


WaveTrichrome {
//Based on Fractal Explorer Orbit Counting
//by Arthur Sirotinsky and Olga Federenko (and Ed Algra).
//but are better in deep zooms.
//& inspired by Paul Derbyshire's renders & Ron Barnett's exp smoothing.
// www.fractalforums.com

//Here colours behave much as waves.
//Channels ara calculated as inversed summs
//by Edgar Malinovsky 17.11.2012.

// 14.08.2013. + triangle transfer function & more colur switches.
// 28.08.2013 + Szegedy Butterfly trap.
// 30.09.2013  + 2 orbits, type 9 now will work from start intended.
//+ random noise taken from Mark Townsend's scripts.

float antilightR, antilightG, antilightB;
parameter float scalarR, scalarG, scalarB;
parameter float lightR, lightG, lightB;
float sumR, sumG, sumB, resultR, resultG, resultB, resultalpha;
float dataR, dataG, dataB, cabsz, xx, yy, zx,zy;
color gradcolor;
parameter float seed;
parameter int orbits, postfn, palette, colmethod;
parameter bool switchrb, switchrg, naturalise;
int cnt;
parameter bool userandom;
parameter float hyperandom;

	void init_once(void)
	{
		antilightR=1/lightR;
		antilightG=1/lightG;
		antilightB=1/lightB;
	}
	void init(void)
	{
		sumR=0;
		sumG=0;
		sumB=0;
		cnt=0;

		dataR=seed;
		dataG=seed;
		dataB=seed;
	}
	void loop(void)
	{
		cnt=cnt+1;
		
		if  (orbits!=0)
		{
			zx= real(z);
			zy= imag(z);
			xx= sqr(zx);
			yy= sqr(zy);
		}

		if  (orbits==0)
		{
			cabsz=cabs(z);
		}
		else if  (orbits==1)
		{
			cabsz= abs(2*xx- yy- sin(yy)) + abs(2*yy- xx- sin(xx));
		}
		else if  (orbits==2)
		{
			cabsz= abs(xx- abs(abs(yy) - cos(abs(xx)))) + abs(yy- abs(abs(xx) - cos(abs(yy))));
		}
		else if  (orbits==3)
		{
			cabsz= abs(xx- yy+ abs(sin(yy))) + abs(yy*yy- xx+ abs(sin(xx)));
		}
		else if  (orbits==4)
		{
			cabsz= abs(2*sin(xx) + abs(yy) - cos(yy*yy)) + abs(2*sin(yy) + abs(xx) - cos(xx*xx));
		}
		else if  (orbits==5)
		{
			cabsz= abs(2*sin(abs(zx)) - abs(zy) - cos(2*abs(zx)))+abs(2*sin(abs(zy)) - abs(zx) - cos(2*abs(zy)));
		}
		else if  (orbits==6)
		{
			cabsz= abs(xx- yy+ sin(yy*yy)) + abs(yy- xx+ sin(xx*xx));
		}
		else if  (orbits==7)
		{
			cabsz= abs(abs(zy) - cos(abs(zx))) + abs(abs(zx) - cos(abs(zy)));
		}
		else if  (orbits==8)
		{
			cabsz= abs(xx-sin(yy) + abs(cos(yy)*sin(0.5*yy))) + abs(xx-sin(xx) + abs(cos(xx)*sin(0.5*xx)));
		}
		else if  (orbits==9)
		{
			cabsz= cabs( (xx- abs(sin(zy)-cos(zx))) + flip(yy- abs(sin(zx)-cos(zy))) + (xx- abs(sin(zy)+cos(zx))) + flip(yy- abs(sin(zx)+cos(zy)))  );
		}
		else if  (orbits==10)
		{
			cabsz=cabs(  complex(  yy- sqrt(abs(zx) ) ,  xx- sqrt(abs(zy))   ) + 1.0E-15);
		}
		else if  (orbits== 11 )
		{
			//arlecchino, modified Mark Townsend harlequin
			cabsz=cabs( zx+flip(zy)- 1- sqr(1.25*real(atan(zx/ (zy+1.0E-15) )) )   +1.0E-15);
			//formulas
		}
		else if  (orbits== 12)
		{
			//Chebyshev4Axolotl
			cabsz=cabs(  ( (xx-yy+flip(2*zx*zy) )*(35 * sqr(xx-yy+flip(2*zx*zy) ) - 30) + 3) / 8  +1.0E-15);
		}

		//here are colour method
if (colmethod==0)
{		
		dataR=  (dataR+1/cnt)/( scalarR+ cabsz*antilightR);
		dataG=  (dataG+1/cnt)/( scalarG+ cabsz*antilightG);
		dataB=  (dataB+1/cnt)/( scalarB+ cabsz*antilightB);
	}
else if (colmethod==1)
{
		dataR=  (dataR)/( scalarR+ cabsz*antilightR);
		dataG=  (dataG)/( scalarG+ cabsz*antilightG);
		dataB=  (dataB)/( scalarB+ cabsz*antilightB);
	}
	
		sumR=sumR+ dataR;
		sumG=sumG+ dataG;
		sumB=sumB+ dataB;
	}
	void final(void)
	{
		resultR= abs(sumR);
		resultG= abs(sumG);
		resultB= abs(sumB);
		//here ends colour method.
		//post modifications of index grade values 0 to 1.

		if  (userandom==true)
		{
			resultR= abs( tanh(hyperandom*real(random)) +resultR);
			resultG= abs( tanh(hyperandom*real(random)) +resultG);
			resultB= abs( tanh(hyperandom*real(random)) +resultB);
		}		
		
		if  (postfn==0)
		{
			//nothing
		}
		else if  (postfn==1)
		{
			resultR=sqr(resultR);
			resultG=sqr(resultG);
			resultB=sqr(resultB);

		}
		else if  (postfn==2)
		{
			resultR=sqrt(resultR);
			resultG=sqrt(resultG);
			resultB=sqrt(resultB);

		}
		else if  (postfn==3)
		{
			resultR=1- resultR;
			resultG=1- resultG;
			resultB=1- resultB;

		}
		else if  (postfn==4)
		{
			resultR=cos(pi*resultR)+resultR*0.5;
			resultG=cos(pi*resultG)+resultG*0.5;
			resultB=cos(pi*resultB)+resultB*0.5;

		}
		else if  (postfn==5)
		{
			sumR= resultR;
			sumG= resultG;
			sumB= resultB;
	
			resultR=abs(resultR-sqrt(sumG*sumB)*0.5);
			resultG=abs(resultG-sqrt(sumR*sumB)*0.5);
			resultB=abs(resultB-sqrt(sumR*sumG)*0.5);

		}
		else if  (postfn==6)
		{
			resultR=sqr(sin(pi*resultR));
			resultG=sqr(sin(pi*resultG));
			resultB=sqr(sin(pi*resultB));
	
		}
		else if  (postfn==7)
		{
			resultR=sin(resultR);
			resultG=sin(resultG);
			resultB=sin(resultB);
	
		}
		else if  (postfn==8)
		{
			resultR= abs( resultR-round(resultR) );
			resultG= abs( resultG-round(resultG) );
			resultB= abs( resultB-round(resultB) );

		}
		else if  (postfn==9)
		{
			resultR=tanh(resultR);
			resultG=tanh(resultG);
			resultB=tanh(resultB);
		}

		else if  (postfn==10)
		{
			resultR=sin((resultR) )*cos((resultG));
			resultG=sin((resultG) )*cos((resultR));
			resultB=sin((resultB) )*cos((resultR));

		}
		else if  (postfn==11)
		{
			resultR=((resultR)/(2+abs(resultR)))*3;
			resultG=((resultG)/(2+abs(resultG)))*3;
			resultB=((resultB)/(2+abs(resultB)))*3;
	 	
		}
		else if  (postfn==12)
		{
			resultR=abs(abs(resultR*0.5-trunc(resultR*0.5))-0.5)*2;
			resultG=abs(abs(resultG*0.5-trunc(resultG*0.5))-0.5)*2;
			resultB=abs(abs(resultB*0.5-trunc(resultB*0.5))-0.5)*2;
  	 	
		}

		// switching red and blue.
		if  (switchrb==true)
		{
			sumB=resultB;
			resultB=resultR;
			resultR=sumB;
		}
		// switching red and green.
		if  (switchrg==true)
		{
			sumB=resultG;
			resultG=resultR;
			resultR=sumB;
		}

		//colour mode: direct, using palette, or mixed.
		if  (palette==0)
		{
		
			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}
			
			pixelcolor= rgb(resultR, resultG, resultB);
		}
		else if  (palette==1)
		{
			pixelcolor= gradient(resultG);
		}
		else if  (palette==2)
		{

			//gradient is by arithmetic mean of RGB
			gradcolor=gradient( (resultR+resultG+resultB)*0.333333333333333 );
			//harmonic of gradient and RGB
			resultR=2/(  recip (red(gradcolor))+ recip(resultR) );
			resultG=2/(  recip (green(gradcolor))+ recip(resultG) );
			resultB=2/(  recip (blue(gradcolor))+ recip(resultB) );
				
			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}				
				
			resultalpha=alpha(gradcolor);
			pixelcolor= rgba(resultR, resultG, resultB,resultalpha);

		}
		else if  (palette==3)
		{
			// colour mode like of Fractal Explorer.
			// uses pallete, but each chanell is calculated seperately.
			resultR=red(gradient(resultR));
			resultG=green(gradient(resultG));
			resultB=blue(gradient(resultB));
			resultalpha=alpha(gradient( resultG));
			
			if  (naturalise==true)
			{
				resultB=resultB*0.8;
			}			
			
			pixelcolor= rgba(resultR, resultG, resultB, resultalpha);

		}
		else if  (palette==4)
		{
			//all waves included.
			pixelcolor=gradient(3/(recip(resultR) + recip(resultG) + recip(resultB) ) );
		}
	}
	void description(void)
	{
		this.title = "Wave Trichrome";
		this.helpfile="http://www.fractalforums.com";

		separator.label2.caption  = "For Gradient change the colour mode";

		palette.caption = "Colour Mode";
		palette.enum= "Direct Colouring\nPallete Based (by green channel)\nMixed Harmonic\nFractal Explorer like\nPallete by harmonic mean";
		palette.default= 3;
		palette.hint= "Gradient Based is gradient calculated from green channel, gradient harmonic is gradient calc from mean of all channels. Mixed is harmonic mean between gradient colour (by mean of RGB) and RGB channels. Fractal Explorer like is RGB values calculated seperately from gradient. All exept direct colouring uses gradient and alpha channel.";
 
		seed.caption = "Start Seed";
		seed.default =  1;
		seed.hint= "Starts colour calculation with this value + 1/ iteration. Density of colour wave depends on this, lowest is somewhere -2.5.";
 
		orbits.caption = "Symmetric Orbits";
		orbits.enum = "None\nType 1\nType 2\nType 3\nType 4\nType 5\nType 6\nType 7\nType 8\nType 9\nSZA Butterfly\nArlecchino\nChebyshev4Axolotl";
		orbits.hint= "Modificates z value, so that it shows additional features."; 

		switchrb.caption = "Switch Red and Blue";
		switchrb.default= false;
		switchrb.hint= "Switch Red and Blue channels.";

		switchrg.caption = "Switch Red and Green";
		switchrg.default= false;
		switchrg.hint= "Switch Red and Green channels, so don't need to change numbers.";

		colmethod.caption = "Method";
		colmethod.enum= "With counter\nCounterless";
		colmethod.default= 0;

		naturalise.caption = "Naturalise Colours  (remove blue tint)";
		naturalise.default= false; 
		naturalise.visible =  (palette== 0||palette== 2||palette== 3);

		postfn.caption = "Transfer Function";
		postfn.enum = "1- None\n2- Square Power (darker)\n3- Square Root (lighter)\n4- Inverted\n5- Half Periodic cos\n6- Accentuate RGB\n7- Haversine\n8- periodic Sine\n9- Solarisation\n10- Hyperbolic Tangent\n11- SineCosineMix\n12- Sigmoid\n13- Triangle";
		postfn.default =   0;
		postfn.hint="The same as UF, but applied before colour mode and have extra functions.";
 
		userandom.caption = "Add Random noise";
		userandom.default =  false;
 
		hyperandom.caption = "Hypertangent noise";
		hyperandom.hint = "Adds a random noise to the colours. Use very small or very large values 0.1 or 50.";
		hyperandom.default =  0.04;
		hyperandom.visible =  (userandom==true); 
 
		separator.label3.caption  = "Increase bailout > 50.";  
		separator.label4.caption  = "Colours here are like 3 waves."; 
 
		lightR.caption = "Red light";
		lightR.default =  0.7;
 
		scalarR.caption = "Red scalar";
		scalarR.default =  0.7;
 
		lightG.caption = "Green light";
		lightG.default =  1.2;
 
		scalarG.caption = "Green scalar";
		scalarG.default =  1.2;
 
		lightB.caption = "Blue light";
		lightB.default =  0.25;
 
		scalarB.caption = "Blue scalar";
		scalarB.default =  0.25;
		
//Colour method is based on Fractal Explorer 
//orbit counting but behave better in deep zooms. 
//Colours here behave as 3 waves. Each channel is 
//calculated as summ of inversed progression 
//throught all the iterations, with calculation 
//starting with start seed. Colour amount and wave 
//lenght depends on light - multiplicator and 
//scalar - addition, working in opposite. Colour
//effects takes place when light and scalar are
//different. It generates large colour value, so
//Direct Colouring mode works with Sine transfer.

	}
}


cPauldebrots_Smooth{
// Intended for Pauldebrot fractal formula.
// by Paul Derbyshire aka Pauldebrot.
//26.10.2013 + random noise texture.

// Intended for Pauldebrot fractal formula. 
// All the code is umodified of Paul Derbyshire aka Pauldebrot post, 
// exept that I added sigmoid transfer function. 
// http://www.fractalforums.com/ultrafractal/complex-2-variable-quadratic-experiment/;

// This coloring method provides smooth iteration
// colors for convergent and divergent fractals and logmap and powermap options.
//
// Variant allows maxit and z_values array to have different size.
//
// Formulas may also be designed to assign some pixels solid color when this coloring is used.
// The formula simply leaves the complex value (501,10) in z when it bails out to do this.
// (There's a vague resemblance between "50110" and "SOlID". :))



real il,lp, ix, sum2, tween, mn, mx;
parameter int power, zmax;
parameter real bailout;
complex z_values[zmax];
int i, j, k,p;
complex zold;
parameter bool convergent,esm, alt,fit, userandom;
bool found;
 parameter real perfix, transpower,fittimes;
parameter int fitminit, fitmaxit,transfer;
parameter float hyperandom;

	void init(void)
	{
		il= 1/log(power);  // Inverse log (power).
		lp= log(log(bailout));  // log(log bailout).
		i= 0;
		sum2= 0.0;
		zold= (0,0);
	}
	void loop(void)
	{
		if (convergent)
		{
			z_values[i] = z;
			i= i+ 1;
			if  (esm)
			{
				sum2= sum2+ exp(-1/cabs(zold-z));
				zold= z;
			}
		}
	}
	void final(void)
	{
		ix= 0;
		if  (z== (501,10))
		{
			solid= true;
		}
		else if  (esm&& convergent)
		{
			index= sum2;
		}
		else
		{

			if  (convergent)
			{
				if  (alt)
				{
					j= zmax- 1;
					if  (i< zmax)
					{
						j= i;
					}
					i= 0;
					found= false;
					while  ((i< j) && !found)
					{
						if  (|z_values[j] - z_values[i]| < (1/bailout))
						{
							found= true;
						}
						else
						{

							i= i+ 1;
						}
					}
					k= i+ 1;
					found= false;
					while  ((k< j) && !found)
					{
						if  (|z_values[j] - z_values[k]| < (1/bailout))
						{
							found= true;
						}
						else
						{

							k= k+ 1;
						}
					}
					p= k- i;
					ix= k/p+ perfix*(log(bailout) + (log(|z_values[i] - z_values[j]|)))/log(|z_values[j] - z_values[i]|/|z_values[j] - z_values[k]|);
				}
				else
				{

					j= zmax;
					if  (i< zmax)
					{
						j= i- 1;
					}
					i= 0;
					found= false;
					while  ((i< j) && !found)
					{
						if  (|z_values[j]-z_values[i]| < (1/bailout))
						{
							found= true;
						}
						else
						{

							i= i+ 1;
						}
					}
					k= i+ 1;
					found= false;
					while  ((k< j) && !found)
					{
						if  (|z_values[j]-z_values[k]| < (1/bailout))
						{
							found= true;
						}
						else
						{

							k= k+ 1;
						}
					}
					p= k- i;
					tween= abs((sqrt(1/bailout) - cabs(z_values[j]-z_values[i])))/(abs(cabs(z_values[j-p]-z_values[i-p]) - cabs(z_values[j]-z_values[i])));
					tween= sin(tween*pi/2);
					tween= tween^(0.73);
					if  (tween< 0)
					{
						tween= 0;
					}
					if  (tween> 1)
					{
						tween= 1;
					}
					ix= i- tween*p;
				}
			}
			else
			{

				ix= (numiter+ il*lp- il*log(log(cabs(z))));
			}
		}
		if  (!esm)
		{
			if  (ix< 1)
			{
				ix= 1;
			}
			mn= fitminit;
			mx= fitmaxit;
			if  (transfer== 1)
			{
				ix= ix^(1/transpower);
				mn= mn^(1/transpower);
				mx= mx^(1/transpower);
			}
			else if  (transfer== 2)
			{
				ix= log(ix);
				mn= log(mn);
				mx= log(mx);
			}
			else if  (transfer== 3)
			{
				ix=4*ix/(3+abs(ix));
				mn=4*mn/(3+abs(mn));
				mx=4*mx/(3+abs(mx));
			}
			if  (fit)
			{
				if  (ix< mn)
				{
					ix= 0;
				}
				else
				{

					ix= (ix- mn)/(mx- mn);
				}
				ix= ix* fittimes;
			}
			else
			{

				ix= 0.05*ix;
			}
			
			if  (userandom==true)
			{
				ix= abs( tanh(hyperandom*real(random)) +ix);
			}			
			
			index= ix;
		}
	}
	void description(void)
	{
		this.title = "Pauldebrots Smooth";
		this.helpfile="http://www.fractalforums.com/ultrafractal/complex-2-variable-quadratic-experiment/"; 
 
		convergent.caption = "Convergent (insides)";
		convergent.default =  false;
		convergent.hint = "Check this for convergent attractors, uncheck to color divergent points.";
 
		esm.caption = "Use exp smoothing";
		esm.default =  false;
		esm.hint = "Applies convergent exponential smoothing as the standard formula of that name, except that fractals can make some areas solid-color.";
		esm.visible =  convergent;
 
		alt.caption = "Use alternate method";
		alt.default =  false;
		alt.visible =  (convergent&& !esm);
 
		perfix.caption = "Period fix factor";
		perfix.default =  1.0;
		perfix.visible =  (convergent&& alt&& !esm);
 
		zmax.caption = "Maximum iterations to record";
		zmax.default =  100;
		zmax.hint = "Determines how many iterations to look ahead for a convergent attractor. If a convergent attractor is not found, the solid color is used for the pixel. Normally you want to use the maximum iterations you selected on the Formula panel, but if you're getting 'out of memory' errors you'll need to set this lower. There's generally little to gain by making it greater than 1,000,000.";
		zmax.visible =  convergent&& !esm;
 
		power.caption = "Exponent";
		power.default =  2;
		power.hint = "This should be set to match the exponent of the formula you are using. For Mandelbrot, this is 2. Only needed when coloring divergent points.";
		power.visible =  !convergent;
 
		fit.caption = "Fit Gradient to Range";
		fit.default =  true;
		fit.hint = "Check this to spread the gradient out over the range of iteration values.";
		fit.visible =  !esm|| !convergent;
 
		fittimes.caption = "Number of repetitions";
		fittimes.default =  1.0;
		fittimes.min = 1.0;
		fittimes.hint = "Repeats gradient the specified number of times over the range of iteration values.";
		fittimes.visible =  fit&& (!esm|| !convergent);
 
		fitminit.caption = "Start iteration";
		fitminit.default =  1;
		fitminit.min = 1;
		fitminit.hint = "Gradient begins at this iteration number. It is best if it's approximately the lowest actual number of iterations in the image. You can find the exact number by looking at Statistics after generating the image once.";
		fitminit.visible =  fit&& (!esm|| !convergent);
 
		fitmaxit.caption = "End iteration";
		fitmaxit.default =  250;
		fitmaxit.min = 1;
		fitmaxit.hint = "Gradient fitting is based on this range of iterations. Can be profitably made lower than maxiter -- try reducing it by factors of 10 until the gradient doesn't fit well, then raise it by a factor of 10 once.";
		fitmaxit.visible =  fit&& (!esm|| !convergent);
 
		transfer.caption = "Super transfer function";
		transfer.enum = "Linear\nPower\nLog\nSigmoid";
		transfer.default =  2;
		transfer.hint = "Linear distributes gradient evenly over iterations. Power weights gradient towards lower iterations for powers > 1. Log weights gradient towards lower iterations.";
		transfer.visible =  !esm|| !convergent;
 
		transpower.caption = "Transfer power";
		transpower.default =  3.0;
		transpower.hint = "Larger values weight gradient more towards low iterations. 3.0 with a regular transfer function of Linear and a super transfer function of Linear with a regular transfer function of CubeRoot produce the same results.";
		transpower.visible =  (transfer== 1) && (!esm|| !convergent);
 
		bailout.caption = "Bail-out value";
		bailout.default =  10000.0;
		bailout.hint = "Larger gives smoother coloring for divergent points, and more accurate and smoother for convergent ones.";
		bailout.min = 1;
		bailout.visible =  !esm|| !convergent;
		
		userandom.caption = "Add Random noise";
		userandom.default =  false;
 
		hyperandom.caption = "Hypertangent noise";
		hyperandom.hint = "Adds a random noise to the colours. Use very small or very large values 0.1 or 50.";
		hyperandom.default =  0.04;
		hyperandom.visible =  (userandom==true);

	}
}


Lyapunov_forduckin{
// For any of Ducks, Ducky, Kalisets, Lucky, Sefir, Duckytalis
// formulas.
// As they are great with Lyapunov
// Plain lyapunov unmodified > 10 years
// Great skeleton but lacks "meat".
// Lyapunov script by Damien M. Jones.
// by Edgar Malinovsky 29.09.2013.

// For Ducks, Ducky, Kalisets, Lucky, Duckytalis and alike insides.
// And Gnarls. With default setings this is identical to plain DMJ
// Lyapunov. Works with mandelbrot set but then it should have equaly
// large bailout value as in colouring + smooth flag.

int iter, cnt;
parameter int iternum, orbits, prefn, postfn;
float oldsum, sum, cabsz, il, lp, smoothing,lnz, zmax, xx,yy,zx,zy;
parameter float seed, power, increment, hyperandom;
parameter int bailout, iterstart;
complex ztemp;
parameter bool limititer, expdim, smooth, userandom;
parameter complex posneg;

	void init_once(void)
	{
		iter=iternum;
		if  (iter>= maxiter)
		{
			iter=maxiter- 1;
		}
		
		il= 1/log(real(power));
		lp= log(log(bailout)/2.0);
	}
	void init(void)
	{
		oldsum= 0;
		sum= seed;
		cnt=0;
		zmax=-1;

	}
	void loop(void)
	{

		if  (cnt<= iter&& cnt>= iterstart||limititer==false)  //calculates first iterations
		{
			//pre functions
			// + 1.0E-15 to avoid strange effects.
			//"trap center"
			ztemp=z+posneg;

			if  (orbits!=0)
			{
				zx= real(ztemp);
				zy= imag(ztemp);
				xx= sqr(zx);
				yy= sqr(zy);
			}

			if  (orbits==0)
			{
				//nothing
			}
			else if  (orbits==1)
			{
				ztemp= (2*xx- yy- sin(yy)) + flip(2*yy- xx- sin(xx));
			}
			else if  (orbits==2)
			{
				ztemp= (xx- abs(abs(yy) - cos(abs(xx)))) + flip(yy- abs(abs(xx) - cos(abs(yy))));
			}
			else if  (orbits==3)
			{
				ztemp= (xx- yy+ abs(sin(yy))) + flip(yy*yy- xx+ abs(sin(xx)));
			}
			else if  (orbits==4)
			{
				ztemp= (2*sin(xx) + abs(yy) - cos(yy*yy)) + flip(2*sin(yy) + abs(xx) - cos(xx*xx));
			}
			else if  (orbits==5)
			{
				ztemp= (2*sin(abs(zx)) - abs(zy) - cos(2*abs(zx)))+flip(2*sin(abs(zy)) - abs(zx) - cos(2*abs(zy)));
			}
			else if  (orbits==6)
			{
				ztemp= (xx- yy+ sin(yy*yy)) + flip(yy- xx+ sin(xx*xx));
			}
			else if  (orbits==7)
			{
				ztemp= (abs(zy) - cos(abs(zx))) + flip(abs(zx) - cos(abs(zy)));
			}
			else if  (orbits==8)
			{
				ztemp= (xx-sin(yy) + abs(cos(yy)*sin(0.5*yy))) + flip(xx-sin(xx) + abs(cos(xx)*sin(0.5*xx)));
			}
			else if  (orbits==9)
			{
				ztemp= (xx- abs(sin(zy)-cos(zx))) + flip(yy- abs(sin(zx)-cos(zy))) + (xx- abs(sin(zy)+cos(zx))) + flip(yy- abs(sin(zx)+cos(zy)));
			}
			else if  (orbits==10)
			{
				ztemp=( yy- sqrt(abs(zx) ) + flip ( xx- sqrt(abs(zy))   ) + 1.0E-15);
			}
			else if  (orbits== 11 )
			{
				//arlecchino
				ztemp=( zx+flip(zy)- 1- sqr(1.25*real(atan(zx/ (zy+1.0E-15) )) )   +1.0E-15);
				//formulas
			}
			else if  (orbits== 12)
			{
				//Chebyshev4Axolotl
				ztemp=(  ( (xx-yy+flip(2*zx*zy) )*(35 * sqr(xx-yy+flip(2*zx*zy) ) - 30) + 3) / 8  +1.0E-15);
			}

			//nexttraps!
			if  (prefn== 0)  // original unmodified
			{
				cabsz= cabs( ztemp+1.0E-15);
			}
			else if  (prefn== 1)
			{
				cabsz= cabs( real(ztemp)- imag(ztemp) +1.0E-15);
			}
			else if  (prefn== 2)
			{
				cabsz= cabs( real(ztemp)* imag(ztemp) +1.0E-15);
			}
			else if  (prefn== 3)
			{
				cabsz= cabs( real(ztemp)% (imag(ztemp) +1E-20) +1.0E-15);
			}
			else if  (prefn== 4)
			{
				cabsz= |ztemp+1.0E-15|;
				// non linear
			}
			else if  (prefn== 5)
			{
				cabsz= cabs( abs(real(ztemp)*2+ imag(ztemp))+ recip(abs(ztemp)+1e-15) +1.0E-15);
			}
			else if  (prefn== 6)
			{
				cabsz= cabs( ( (real(ztemp))*2+ (imag(ztemp))/((real(ztemp))+ (imag(ztemp))+ (1.9,0.1) )  ) +1.0E-15);
			}
			else if  (prefn== 7)
			{
				cabsz= cabs( (round(ztemp) +ztemp)*0.5 +1.0E-15);
			}
			else if  (prefn== 8)
			{
				cabsz= cabs( sinh( ztemp)  +1.0E-15);
			}
			else if  (prefn== 9)
			{
				cabsz= cabs( cos( ztemp)  +1.0E-15);
				// symmetric
			}
			else if  (prefn== 10)
			{
				cabsz=cabs( sqr(imag(ztemp)) - sqrt(abs(real(ztemp))) + flip (sqr(real(ztemp)) - sqrt(abs(imag(ztemp) ))) + 1.0E-15);
			}
			else if  (prefn== 11)
			{
				cabsz= cabs(( sqr(sqr( imag(ztemp) )) + sqr(sqr( real(ztemp) )) + 1.0E-15  ) ^0.25 );
				//back to basic
			}
			else if  (prefn== 12)  // real
			{
				cabsz= abs(real( ztemp+1.0E-15));
			}
			else if  (prefn== 13)  // imag
			{
				cabsz= abs(imag( ztemp)  +1.0E-15);
				//from orbit trap	
			}
			else if  (prefn== 14)
			{
				// "hyperbola"
				cabsz= abs(imag(ztemp) * real(ztemp) - 1+1.0E-15);
				// from thin orbit trap of Samuel Monnier
			}
			else if  (prefn== 15 )
			{
				//sincos waves
				cabsz= abs( sin(real(ztemp)) + cos(real(ztemp)) + imag(ztemp) +1.0E-15 );
			}
			else if  (prefn== 16 )
			{
				//parabola
				cabsz= abs( sqr(real(ztemp)) - imag(ztemp) +1.0E-15);
			}
			else if  (prefn== 17 )
			{
				//trifolium
				cabsz= abs(8/( sqr(real (ztemp) )  +4) - imag(ztemp) +1.0E-15);
				//harlequin
			}
			else if  (prefn== 18 )
			{
				//arlecchino, modified Mark Townsend harlequin.
				cabsz=cabs( ztemp- 1- sqr(1.25*real(atan( real(ztemp) / (imag(ztemp)+1.0E-15 ) )) )   +1.0E-15);
				//formulas
			}
			else if  (prefn== 19)
			{
				//Chebyshev4Axolotl
				cabsz=cabs(  (sqr(ztemp)*(35 * sqr(ztemp) - 30) + 3) / 8  +1.0E-15);
			}


			//finding max z.
			if  (expdim== true)
			{
				lnz=exp(-cabsz);
				if  (lnz> zmax)
				{
					zmax= lnz;
				}
			}

			oldsum= sum;
			sum= sum* (increment*cabsz);  // sum the Lyapunov exponent
		}
		cnt=cnt+1;
	}
	void final(void)
	{

		sum= log(abs(sum));

		sum= abs(sum/numiter);


		if  (smooth)
		{
			oldsum= log(abs(oldsum));
			oldsum= abs(oldsum/(numiter-1));
  
			smoothing= il*lp- il*log(log(cabs(z)));
			sum= oldsum+ (sum-oldsum) * (smoothing+1);
		}
		else
		{

			//sum = sum
		}

		if  (expdim== true)
		{
			sum=sum/(1+ zmax);
		}

		if  (userandom==true)
		{
			sum= abs( tanh(hyperandom*real(random)) +sum);
		}

		//post functions
		if  (postfn==0)
		{
			//nothing
		}
		else if  (postfn==1)
		{
			sum=cos(pi*sum)+sum*0.5;
		}
		else if  (postfn==2)
		{
			sum=cos(sum);
		}
		else if  (postfn==3)
		{
			sum=sqr(sin(pi*sum));
		}
		else if  (postfn==4)
		{
			sum=sin(sum);
		}
		else if  (postfn==5)
		{
			sum=sum*0.5 + 0.5/sum;
		}
		else if  (postfn==6)
		{
			sum=tanh(sum);
		}
		else if  (postfn==7)
		{
			sum= abs( sum-round(sum) );
		}
		else if  (postfn==8)
		{
			sum=((sum)/(2+abs(sum)))*3;
		}
		else if  (postfn==9)
		{
			sum=abs(abs(sum*0.5-trunc(sum*0.5))-0.5)*2;
		}
		index=sum;
	}
	void description(void)
	{
		this.title = "Lyapunov Forduckin";

		separator.label2.caption  = "For Ducks, Ducky, Kalisets, Talis insides.";
		separator.label3.caption  = "With mandelbrot Smooth Colour flag";
 
		posneg.caption = "Add to z value";
		posneg.default =   (0, 0);
		posneg.hint = "The same as trap center. Adding number diverses negative Z areas and marks -n with dots. Say 2 marks all pixels where z=-2 with dots (technicaly zeroes).";
 
		limititer.caption="Limited iterations";
		limititer.default= false;
 
		iternum.visible =  (limititer==true);
		iternum.caption="Use max iterations";
		iternum.default= 7770000;
		iternum.min=1;
		iternum.hint="Specify the iteration cycle at which colouring is applied. Using just few first iterations would make fractal much smoother.";
 
		iterstart.visible =  (limititer==true);
		iterstart.caption = "Start iteration";
		iterstart.default= 5;
		iterstart.min=0;
 
		orbits.caption = "Symmetric Orbits";
		orbits.enum = "None\nType 1\nType 2\nType 3\nType 4\nType 5\nType 6\nType 7\nType 8\nType 9\nSZA Butterfly\nArlecchino\nChebyshev4Axolotl";
		orbits.hint= "Used instead of modulus. So that it shows additional features.";
 
		prefn.caption = "Pre Function";
		prefn.enum = "1 None\n2 X-Y\n3 X*Y\n4 remainder of X/Y\n5 X*X+Y*Y\n6 Stalks A\n7 Stalks B\n8 Areas\n9 Sinh\n10 Cos\n11 SZA Butterfly\n12 Supermodulus 4\n13 Real\n14 Imag\n15 Hyperbola\n16 Sincos Waves\n17 Parabola\n18 Trifolium\n19 Arlecchino\n20 Chebyshev4Axolotl";
		prefn.default =   0;
		prefn.hint= "Pre function applied before colour calculations. Changes colour pattern, like orbit traps. Some pre functions with non-standart (Eulers) exponent bases could require additional (number) precision. If artefacts appears try to change bailout value in interval 50 < bailout < 1000.";
 
		expdim.caption = "E dimension smoothing";
		expdim.default =  false;
		expdim.hint = "Divides colour value by max inverse exponent. Sometimes generates smoother result, with a kalisets /ducky can generate sharper patterns.";
 
		seed.caption= "Start Seed";
		seed.default= 1.0;
		seed.hint="Starts calculation with this number, so it must not be zero.";
  
		increment.caption = "Multiplicator";
		increment.default= 2;
 
		postfn.caption = "Transfer Function";
		postfn.enum = "1- None\n2- Half Cosine\n3- Cosine\n4- Haversine\n5- Sine\n6- DoubleEdged\n7- Hyperbolic Tangent\n8- Solarisation\n9- Sigmoid\n10- Triangle";
		postfn.default =   0;
		postfn.hint= "The same as built in colour transfer, but with additional functions.";
 
		smooth.caption = "Smooth Coloring";
		smooth.default =  false;
		smooth.hint = "If set, results will be 'smoothed' to hide iteration bands.";
 
		power.caption = "Exponent";
		power.default =  2.0;
		power.hint = "This should be set to match the exponent for Mandelbrot formula.";
		power.visible =  (smooth==true);
 
		bailout.caption = "Bailout";
		bailout.default =  10000;
		bailout.min = 1;
		bailout.hint = "This should match bailout of Mandelbrot.";
		bailout.visible =  (smooth==true);
 
		userandom.caption = "Add Random noise";
		userandom.default =  false;
 
		hyperandom.caption = "Hypertangent noise";
		hyperandom.hint = "Adds a random noise to the colours. Use very small or very large values 0.1 or 50.";
		hyperandom.default =  0.04;
		hyperandom.visible =  (userandom==true);
	}
}