Title: Creating custom fractals on Kalles Fraktaler? Post by: greentexas on April 12, 2017, 10:53:17 PM Let's say you downloaded a copy of Kalles Fraktaler. Is it possible to edit the source code so your copy could have a custom fractal?
Here's an example: Let's say you had some version of: a = a * a - b * b + x b = 2 * a * b + y Could you modify this slot to be: a = a * a * abs(a - b * b) + x b = a * x - b + y? Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: Kalles Fraktaler on April 12, 2017, 11:11:53 PM With perturbation you cannot unfortunately multiply the x and the y
Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: claude on April 14, 2017, 02:07:51 AM Suppose you have your formula, and have done the maths to derive the perturbation iterations, then you need to pick a new m_nFractalType identifier number, give it a name for the GUI, and implement 6 pieces of code (really 2 pieces, but the duplication is needed in lieu of using C++ templates or similar):
* double reference iterations in fraktal_sft/fraktal_sft.cpp * long double reference iterations in fraktal_sft/dbl_functions.cpp * floatexp reference iterations in fraktal_sft/exp_functions.cpp * double pertubation iterations in fraktal_sft/fraktal_sft.cpp * long double perturbation iterations in ldbl/ldbl.cpp * floatexp pertubation iterations in fraktal_sft/exp_functions2.cpp I wonder if it's possible to rejig all this part of the code, remove the duplication across different types by using templates, and make it easier to add new formulas - perhaps by having a class per formula? OOP programming isn't really my thing... I don't know enough about Windows programming (or that part of Kalles Fraktaler) to help with adding your new fractal type to the GUI. But you probably shouldn't publish your changes without coordinating with Karl, because otherwise all chaos could occur with different formula having the same fractal type number in different forks, making settings files incompatible... EDIT since posting this I changed the way formulas are compiled in Kalles Fraktaler. There is now a preprocessor that compiles a formula definition from XML to C++. Defining new formulas would now work like this example: Code: <formulas> * Append a new group with the next consecutive unused type number and name. * For each power, add a formula with the Pauldelbrot glitch detection threshold. * The formula needs a reference part and a perturbation part. * The parts can have type R (separate real and imaginary) or C (complex variables) - see the file for examples: https://code.mathr.co.uk/kalles-fraktaler-2/blob/503dcfc3c3f851d986c46bfebbcfec1abe092745:/formula/formula.xml * Operators include + - * ^ * Functions include sqr(x) (reference only), abs(x), diffabs(x, y) where diffabs() is the magic formula for perturbation developed by laserblaster here http://www.fractalforums.com/new-theories-and-research/perturbation-formula-for-burning-ship-(hopefully-correct-p)/ Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: claude on April 14, 2017, 03:35:10 AM With perturbation you cannot unfortunately multiply the x and the y With ideal mathematical perturbation (infinite precision everywhere), you can do it. The problems can happen when you limit the precision of the deltas (while keeping a high precision reference). It works out when the deltas are small compared to the high precision values. For greentexas' formula I get this for the perturbation iteration of b (lower case is low precision deltas, upper case is high precision reference): Code: b = A x + X a + a x - b + y As far as I can tell, if the deltas are small, then the right hand side is small as well (every term has at least one small multiplier). Will try to implement it in KF2, together with a separate non-perturbation high precision test program to validate my hunch that in this case it might work out fine... Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: Kalles Fraktaler on April 14, 2017, 03:45:15 PM With ideal mathematical perturbation (infinite precision everywhere), you can do it. The problems can happen when you limit the precision of the deltas (while keeping a high precision reference). It works out when the deltas are small compared to the high precision values. Yes, I gone that path and found out that the multiplication of the pixel does not work.For greentexas' formula I get this for the perturbation iteration of b (lower case is low precision deltas, upper case is high precision reference): Code: b = A x + X a + a x - b + y As far as I can tell, if the deltas are small, then the right hand side is small as well (every term has at least one small multiplier). Will try to implement it in KF2, together with a separate non-perturbation high precision test program to validate my hunch that in this case it might work out fine... I can be mistaken of course, but unfortunately it seems not. And this seems also be the reason why you cannot make Julia fractals with perturbation, because that's all about multiplying the pixel. Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: LionHeart on April 17, 2017, 02:30:25 PM Hi Guys,
Maybe it's possible to use a fractal interpreter. I haven't been able to make perturbation work in my program, but I do have a parser that enables one to experiment with fractals. It's based on the old FRACTINT code and works fairly well. I use it to experiment with new fractals. Now if one can adapt it for Kalles Fraktaler using perturbation, that would allow the user to create any fractal they like. FRACTINT requires a text file to be read, but I have a screen based interface that makes it easier. Just an idea :) Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: LionHeart on April 18, 2017, 04:46:26 AM Hi Guys,
Here are the 8 SimonBrot images I produced so far using the algorithm in my previous post. Simonbrot 2nd, 3rd, 4th, 5th, 6th, 7th, 8th and 9th: The formulas for these fractals are: z^1.0 * |z|^2 + pixel, z^1.5 * |z|^2 + pixel, z^2.0 * |z|^2 + pixel, z^2.5 * |z|^2 + pixel, z^3.0 * |z|^2 + pixel, z^3.5 * |z|^2 + pixel, z^4.0 * |z|^2 + pixel, z^4.5 * |z|^2 + pixel. (http://deleeuw.com.au/misc/SimonBrot.jpg) Can anyone verify the fractional ones? Many thanks Paul the LionHeart Title: Re: Creating custom fractals on Kalles Fraktaler? Post by: LionHeart on April 18, 2017, 04:49:02 AM Opps, sorry, I put this in the wrong place. :embarrass: |