I have created fast some coloring method to show it can look very different.

Mandelbrot-halmaz a Wikipédián

Bertalan Ágnes - A Mandelbrot halmaz - 2011

Bastian Fredriksson - An introduction to the Mandelbrot set - January 2015

If you would like to extract fractal images under Linux you can try GnoFract 4d.

Available for Linux. - https://www.mathworks.com/

"MATLAB is a programming and numeric computing platform used by millions of engineers and scientists to analyze data, develop algorithms, and create models."

GNU Octave website: Powerful mathematics-oriented scientific programming language with 2D/3D plotting and Matlab script compatibility

My simple code for Mandelbrot set in GNU Octave:

```
itercount = 1000;
bailout = 10;
step = 0.03 #decrease step for better resolution
x=-2;
y=-1.2;
hold ("on");
for x = -2:step:1
for y=-1.2:step:1.2
n=0;
absz = 0;
a = 0; #complex z = (a,b)
b = 0;
do
newx = a*a - b*b + x; #real of z^2+c
newy = 2*a*b + y; #imag of z^2+c
a = newx; #z(n+1) = (newx, newy)
b = newy;
absz = sqrt(a*a + b*b); #abs(z)
n++;
until ((n==itercount) || (absz>bailout))
if (n==itercount)
plot( x , y ) ;
endif
endfor
endfor
hold ("off");
```

Happily Octave knows arithmetical operations on complex numbers, so you can make easier script.

*Mandelbrot_iter.m*

```
#
# Returns the number of succesfull iterations
#
function retval = Mandelbrotxy( z, e, c, maxiter, bailout )
n = 0;
do
z = z.^e + c;
n++;
until ( (abs(z)>bailout) || (n==maxiter) );
retval = n;
endfunction
```

*Mandelbrot_set.m*

```
texts = {"Max iteration", "Bailout", "Step","Exponent of z^n+c","cx","cy"};
defaultvalues = {"1000", "10", "0.05","2","0","0"};
inputsizes = [1,10; 1,10; 1,10; 1,10; 1,10; 1,10];
settings = inputdlg (texts, "Settings", inputsizes, defaultvalues);
maxiter = str2num(settings{1});
bailout = str2num(settings{2});
step = str2num(settings{3});
exponent = str2num(settings{4});
cx = str2num(settings{5});
cy = str2num(settings{6});
if (maxiter<=0)
maxiter = 1000;
endif
if (bailout<=0)
bailout = 10;
endif
if (step<=0) || (step>=1)
step = 0.05;
endif
if (exponent<1) || (exponent>=50 )
exponent = 2;
endif
hold('on');
for x= -2:step:2;
for y= -1.2:step:1.2;
if ((cx==0) && (cy==0)) # Mandelbrot
z0 = 0; # z0 = 0;
c = complex(x,y); # (x,y) for Mandelbrot
else # Julia
z0 = complex(x,y); # z0 = (x,y) for Julia
c = complex(cx,cy); # e.g. -0.442444, 0.556128
endif
n = Mandelbrot_iter( z0, exponent, c, maxiter, bailout )
if (n==maxiter)
plot( x, y );
endif
endfor
endfor
hold('off');
```

Plotting to figure is the simplest way for displaying set, more colorfull solution is creating an *image* and assigning a color from *colormap* to iteration number. My favourite to create Z with a *meshgrid* and generate the iteration number matrix at once using filter mask, and the result array can be displayed with *imagesc*. In this case you can work with result data further more before displaying and also you can *save*/export for later use and then just have to *importdata*.

**π as Dave Boll discovered:**

*Calc_PI_with_Mandelbrot.m with (−0.75, ε)*

Calculated Pi~: 3.000000

Calculated Pi~: 3.300000

Calculated Pi~: 3.150000

Calculated Pi~: 3.143000

Calculated Pi~: 3.141700

Calculated Pi~: 3.141600

Calculated Pi~: 3.141593

PI = 3,1415926535 ...

Calculated Pi~: 3.300000

Calculated Pi~: 3.150000

Calculated Pi~: 3.143000

Calculated Pi~: 3.141700

Calculated Pi~: 3.141600

Calculated Pi~: 3.141593

PI = 3,1415926535 ...

```
#
# Calculate PI with Mandelbrot /discovered by Dave Boll/
#
n = 6; #number of decimals
z0 = 0; # z0 = complex( 0,0 );
exponent = 2;
cx = -0.75; # by Dave Boll
cy = 1/10^n;
c = complex( cx, cy );
bailout = 2;
calcpi = Mandelbrot_iter( z0, exponent, c, 0, bailout );
printf("PI = 3,1415926535 ... /n");
printf("Calculated Pi~: %f /n",calcpi*cy);
```

Another route with (0.25+ε ,0)

Calculated Pi~: 2.000000

Calculated Pi~: 2.529822

Calculated Pi~: 3.000000

Calculated Pi~: 3.067409

Calculated Pi~: 3.120000

Calculated Pi~: 3.133817

Calculated Pi~: 3.140000

Calculated Pi~: 3.141090

Calculated Pi~: 3.141400

Calculated Pi~: 3.141533

Calculated Pi~: 3.141570

Calculated Pi~: 3.141587

PI = 3,1415926535 ...

Calculated Pi~: 2.529822

Calculated Pi~: 3.000000

Calculated Pi~: 3.067409

Calculated Pi~: 3.120000

Calculated Pi~: 3.133817

Calculated Pi~: 3.140000

Calculated Pi~: 3.141090

Calculated Pi~: 3.141400

Calculated Pi~: 3.141533

Calculated Pi~: 3.141570

Calculated Pi~: 3.141587

PI = 3,1415926535 ...

```
z0 = 0;
exponent = 2;
for n = 0:1:11;
e = 1/10^n;
cx = 0.25+e;
cy = 0;
c = complex( cx, cy );
bailout = 2;
calcpi = Mandelbrot_iter( z0, exponent, c, 0, bailout );
printf("Calculated Pi~: %f /n",calcpi*sqrt(e));
endfor
printf("PI = 3,1415926535 ... /n");
```

Refferences:

https://www.cheenta.com/pi-calculating-from-mandelbrot-set-using-julia/

https://www.doc.ic.ac.uk/~jb/teaching/jmc/pi-in-mandelbrot.pdf

"bc is an arbitrary precision numeric processing language." https://www.gnu.org/software/bc/bc.html

3D War game for Linux

You can play with historical vehicles (planes, tanks, ...) worldwide.

Fractal generation, Mandelbrot set, Julia set

WebGL TEST!

Simple test with a dualcone and more 3d objects:

23-07-2016

River fishing is an interesting way to catch fishes in a flowing water...

Me and my friends spent good days at Lake Warali in Baja.

17-05-2015

I tried different Lake, they say there are big fishes. Every time I had fished here I caught 4+ carps too.

may-2012

23-10-2011

03-10-2010

**WARNING!!!**

You can buy USB FLASH DRIVES and MP3/MP4/MP5 PLAYERS with FAKE memory sizes on the Internet!

Visitcount (since 2021-05-30): 0801