# programme code - ix

Submitted by mfg on Mon, 05/09/2016 - 19:09

The iteration, now of three functions should be performed in an efficient and fast language, for example C++. In brackets here below, the recurrence relationships.

In order to include the fractal ix involving the quadratic iteration of imaginary scators:

• add in Mandelbulber, v 2.07-1file /src/fractal_formulas.cpp

/* quadratic iteration in imaginary scator algebra */
void ImaginaryscatorPower2Iteration(CVector3 &z)
{
double x2 = z.x * z.x;
double y2 = z.y * z.y;
double z2 = z.z * z.z;
double newx = x2 - y2 - z2 + (y2 * z2) / x2;
double newy = 2.0 * z.x * z.y * (1 - z2 / x2 );
double newz = 2.0 * z.x * z.z * (1 - y2 / x2 );
z.x = newx;
z.y = newy;
z.z = newz;
}

void ImaginaryscatorPower2Iteration(CVector3 &z);

fractalList->append(sFractalDescription("Imaginary scator Power 2", "imagsca_power_2",
fast_imagsca_power2,
analyticDEType,
logarithmicDEFunction,
cpixelEnabledByDefault,
10));

fast_imagsca_power2 = 152,

case fast_imagsca_power2:
{
ImaginaryscatorPower2Iteration(z);
break;
}
• also modfy and add in line 711
// r calculation
// r = sqrt(z.x * z.x + z.y * z.y + z.z * z.z + w * w);
switch(fractal->formula)
{
default:
{
r = sqrt(z.x * z.x + z.y * z.y + z.z * z.z + w * w);
break;
}
//scator magnitudes
// magnitude in imaginary scator algebra
case fast_imagsca_power2:
{
r = sqrt(z.x * z.x + z.y * z.y + z.z * z.z + (z.y * z.y * z.z * z.z) / (z.x * z.x) );
break;
}
}

• also add: in switch (formula) line 836

case fast_imagsca_power2:

• add in /usr/share/mandelbulber2/language/ qt_data_en.ts (en dos lugares) just after "../qt_data/fractal_mandelbulb_power_2.ui"
<location filename="../qt_data/fractal_imagsca_power_2.ui" line="14"/>
<location filename="../qt_data/fractal_imagsca_power_2.ui" line="20"/>
• copy file archivo fractal_mandelbulb_power_2.ui en /usr/share/mandelbulber2/qt_data with name

fractal_imagsca_power_2.ui

• compile and install
cd makefiles
qmake mandelbulber.pro
make all
cd ..
./install

## settings

The most relevant parameteers are:
• to stop at maximum iteration
• to force the Delta DE distance estimation method
• better, but not esential to have a large bailout number
In the lines here below, typical settings of a .fract Mandelbulber file
# Mandelbulber settings file
# version 2.07
# only modified parameters
[main_parameters]
aux_light_enabled_1 true;
aux_light_intensity_1 1;
aux_light_position_1 1 -3 -2;
bailout 100000;
camera 0.1 -3 0;
camera_distance_to_target 3.001666203960727;
camera_rotation 1.909152432996377 0 0;
camera_top 0 0 1;
delta_DE_method 1;
flight_last_to_render 0;
formula_1 152;
iteration_threshold_mode true;
keyframe_last_to_render 0;
use_default_bailout false;