Welcome to Fractal Forums

Fractal Software => Plugins => Topic started by: simon.snake on May 01, 2013, 11:51:47 PM




Title: A challenging new plugin for panzerboy...
Post by: simon.snake on May 01, 2013, 11:51:47 PM
Here's a fairly simple formula I wrote in FractInt.

It doesn't use a radius bailout, but simply iterates 50 times, and uses the outside colouring option tdis, which is the total distance the point travels. I'm not sure exactly how this works, but I would hope it would be fairly trivial to implement in Fractal eXtreme.  This might push panzerboy's expertise a bit.  I hope he can pull it off.  I would have a go myself, but I can't compile the plugins in 64-bit mode. I might have a go myself!

Code:
simon0047-A {
  ; Set outside colouring to tdis
  ; Set Iterations to 150
  ;
  ; SMF - Added julia 28/04/2012
  ;       (works really well)
  if (ismand)
    z = 0
    p = pixel
  else
    z = pixel
    p = p1
  endif
  c = 0:
  z = abs(z*z)-abs(p*p)
  c = c + 1
  c < 50
}

Here's an example of the initial image it creates:

(http://www.needanother.co.uk/uploads/smf00277.gif)

Here's the bit where I grovel... I am happy to wait until after the competition as I expect you are quite busy.

Many thanks,

Simon


Title: Re: A challenging new plugin for panzerboy...
Post by: simon.snake on May 02, 2013, 03:48:01 PM
One thing I've found which appears to be useful is a Chaospro formula file which defines the colouring methods used in FractInt.

This should help work out how the tdis parameter works.

http://www.chaospro.de/formulas/display.php?fileid=178 (http://www.chaospro.de/formulas/display.php?fileid=178)

Hope that is of interest to someone.


Title: Re: A challenging new plugin for panzerboy...
Post by: panzerboy on May 14, 2013, 05:55:45 AM
Okay that looks simpler than my thinking.

Code:
		if (iOutside=="tdis")
{
distance=distance+cabs(z-prevZ);
prevZ=z;
}
With complex addition or subtraction, the reals add with the reals and imaginaries adds with imaginaries.

Oops maybe I've talked too soon.
distance is defined as real (floating point?), z and prevZ are complex.
There must be a conversion from the 2 number complex into a single number real.
Usually that means taking the square root of (real squared + imaginary squared).

A bit of reseach suggests that conversion from complex to real only takes the real component of the cpmplex number and ignores the imaginary.
http://www.chaospro.de/documentation/html/formulacompiler/languagereference/datatypes/real.htm

Phew!
That'll make things easier, no need to keep the previous imaginary values and most importanly no need to create a square root code for high precision.




Title: Re: A challenging new plugin for panzerboy...
Post by: simon.snake on May 19, 2013, 01:32:36 AM
Looking up the FractInt trig identities, the definition for cabs is as follows:

Code:
cabs(x+iy) = sqrt(x^2 + y^2)

When defining the HighPrecMath part of the code, you could simply make the distance a double, and use the DoubleFromFixed function to convert back to doubles, and then use the following:

Code:
double distance;

    distance += sqrt(doublefromfixed(zrsqr+zisqr));

Seems like it should work to me, but then I am a novice... :-)