Logo by Dinkydau - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. March 28, 2024, 06:39:12 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: Creating custom fractals on Kalles Fraktaler?  (Read 11495 times)
Description: Is it possible to modify a copy of Kalles Fraktaler?
0 Members and 1 Guest are viewing this topic.
greentexas
Navigator
*****
Posts: 64


« 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?
Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #1 on: April 12, 2017, 11:11:53 PM »

With perturbation you cannot unfortunately multiply the x and the y
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #2 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>
<group type="0" name="Mandelbrot">
  <formula power="2" glitch="0.0000001">
    <reference t="R">
        Xrn = Xr2 - Xi2 + Cr;
        Xin = sqr(Xr + Xi) - Xr2 - Xi2 + Ci;
    </reference>
    <perturbation t="R">
        xrn = (2 * Xr + xr) * xr - (2 * Xi + xi) * xi + cr;
        xin = 2 * ((Xr + xr) * xi + Xi * xr) + ci;
    </perturbation>
  </formula>
  ...
</group>
...
</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)/
« Last Edit: September 21, 2017, 07:41:25 PM by claude, Reason: described preprocessor » Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #3 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... (I already worked out the pertubation formula for 'a' using laserblaster's trick but I'm too lazy to type it up in this post) EDIT nope, made mistakes, is harder than I thought due to perturbation formula being like P |Q + q| - R |Q|, the extra factors outside the || mess everything up.  EDIT AGAIN actually the P R factors are always non-negative so it works out after all - doesn't work however sad  I guess you can't multiply after all...
« Last Edit: April 14, 2017, 10:53:41 AM by claude » Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #4 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.

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 already worked out the pertubation formula for 'a' using laserblaster's trick but I'm too lazy to type it up in this post) EDIT nope, made mistakes, is harder than I thought due to perturbation formula being like P |Q + q| - R |Q|, the extra factors outside the || mess everything up.  EDIT AGAIN actually the P R factors are always non-negative so it works out after all - doesn't work however sad  I guess you can't multiply after all...
Yes, I gone that path and found out that the multiplication of the pixel does not work.
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.
Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
http://www.facebook.com/kallesfraktaler
LionHeart
Explorer
****
Posts: 46



« Reply #5 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 smiley
Logged

Paul the LionHeart
LionHeart
Explorer
****
Posts: 46



« Reply #6 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.
 


Can anyone verify the fractional ones?

Many thanks

Paul the LionHeart


* SimonBrot.jpg (125.32 KB, 1278x687 - viewed 210 times.)
Logged

Paul the LionHeart
LionHeart
Explorer
****
Posts: 46



« Reply #7 on: April 18, 2017, 04:49:02 AM »

Opps, sorry, I put this in the wrong place.

 embarrass
Logged

Paul the LionHeart
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Kalles Fraktaler 2 Kalles Fraktaler « 1 2 ... 29 30 » Kalles Fraktaler 438 107015 Last post July 31, 2014, 12:29:56 AM
by cKleinhuis
Kalles Fraktaler 2.5.7 Kalles Fraktaler « 1 2 » Kalles Fraktaler 20 19776 Last post October 25, 2017, 07:26:34 PM
by Mrz00m
Kalles Fraktaler 2.7 Kalles Fraktaler « 1 2 3 » Kalles Fraktaler 35 26526 Last post October 13, 2014, 04:45:04 PM
by youhn
Kalles Fraktaler 2.7.4 available Kalles Fraktaler Kalles Fraktaler 10 6991 Last post November 30, 2014, 01:40:48 PM
by ratcat65
Creating derivatives of Kalles Fraktaler? Help & Support greentexas 3 291 Last post March 01, 2017, 04:43:43 PM
by DarkBeam

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.652 seconds with 26 queries. (Pretty URLs adds 0.01s, 2q)