This program generates the orbit for a given Mandelbrot point. Something like:
That's the orbit of point (-1.3,0) which has period 4.
This is the Mnadelbrot Set basic formula:
f(z) = z² + c
where z
and c
are complex number.
The Mandelbrot set is the set of complex numbers c
for which the function does not diverge when iterated from z=0.
Than means, given a c
complex number, if you apply the formula to that number n
times using the previous result as the new z
number, that c
belongs to Mandelbrot Set if the sequence does not diverge.
This python script plots the series for a given complex point.
Python 3.6.9
pytest-5.3.5
Install:
./bin/install
Run:
mandelbrot-orbit '{ZX}' '{ZY}' {NUM_ITERATIONS} {OUPUTFILE}
mandelbrot-orbit -0.1 0.7 100 ./mandelbrot_orbit.png
The script generates an image: mandelbrot-orbit.png
Setup:
./bin/dev-setup
Running the tests:
./bin/test
Run:
./bin/run '-0.1' '0.7' 100 ./output/mandelbrot_orbit.png
You could see this error:
/home/josecelano/.local/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3.py:195: Warning: Source ID 8 was not found when attempting to remove it
GLib.source_remove(self._idle_draw_id)
It seems to be a known issue pending to release:
- Although calculations are done with an arbitrary precision library, we use
matplotlib
to generate the graph and that package uses a float type for data source so we cannot plot a point with greater precision than the language float precision.