# Fractals/book

Book here means :
* unnamed ( old) c program by Claude Heiland-Allen
** one gui program
** set of the console programs
*** https://gitlab.com/adammajewski/mandelbrot-book_book/
* book in pdf format about : " how to write a book about the Mandelbrot set ".
** official version
** Here is unofficial version of pdf file ( 68.3 MB )

# versions

* book console program using stream
* book GUI program is mostly abandoned now.
* It is forked to m-perturbator in the mandelbrot-perturbator repository
* see also libraries:
** mandebrot-numerics
** mandebrot-graphics

## cli

* sh file ( main program
* c file in bin directory
* c and h files in lib directory

# Features

* zoom with automatic dynamic precision
* free c source code
* uses Newton method to compute :
** center ( nucleus)

## Plane description

Radius is defined as "the difference in imaginary coordinate between the center and the top of the axis-aligned view rectangle". Radius has no initial value.

## Algorithms

Images with full src code :
* level sets of escape time ( = exterior ) of Mandelbrot set
* continous escape time
* atom domains algorithm
* exterior :
** Smooth colouring with continuous escape time
** grid based on integer escape time and binary decomposition
** Atom domains
** external rays : the Newton Method
* boundary : distance estimation ( DEM/M)
* interior :
** Interior coordinates
** Atom domains
All algorithms are described in the book : "How To Write A Book About The Mandelbrot Set" by Claude Heiland-Allen

### nucleus or center

See function mandelbrot_nucleus function from book/code/gui/main.c. It uses Newton method.
Compare with the muatom function in mightymandel/src/atom.c

### Parameter external ray in

Code for computing external ray inwards using Newton method, mpfr and gmp library, based on the code from the library External angle is read from the string ( binary fraction)

# instal
## dependencies

* OpenGl
** GL/glew.h ( libglew-dev )
* Gtk ( GUI

## clone

First clone the official git repository :
or the old one ( deprecated):
or you can use unofficial repository :

## recompile

First:
then make again

## pdf

First
then to make book in pdf format :
* go to book/book directory
* build
or use unofficial version with full c code

## update
### git

From console opened in the mandelbrot-numerics directory :
If you made some local changes you can undu them :
then
Now install again

# run

There are 2 types of the last versions of book program:
* console
* gui
To run gui program:
To run console program use bash scripts, see examples :

## Examples

* for the console programs are bash sh files and use pipeline ( stream)
* for gui version program ( /gui/mandelbrot_gui , see Makefile) reads parameters from the text files

### for console program

Extended use :

#### helper programs
##### period

usage :
example :
next example :
If nucleus in not inside rectangle defined by above parameters then returns 0

##### Compute nucleus

usage:
example :

##### angles
###### mandelbrot_external_angles

Compute angles of rays landing on the root point, usage:
example :
New :
result :
Another :

###### mandelbrot_describe_external_angle

G Pastor gave an example of external rays for which the resolution of the IEEE 754 is not sufficient:
$\theta _{267}^{-}=0.((001)^{88}010)_{2}={\frac {33877456965431938318210482471113262183356704085033125021829876006886584214655562}{237142198758023568227473377297792835283496928595231875152809132048206089502588927}}$
$\theta _{267}^{+}=0.((001)^{87}010001)_{2}={\frac {33877456965431938318210482471113262183356704085033125021829876006886584214655569}{237142198758023568227473377297792835283496928595231875152809132048206089502588927}}$
$\theta _{3}^{-}=0.(001)_{2}={\frac {1}{7}}=0.(142857)_{10}$ ( period 3, lands on root point of period 3 component c3 = -0.125000000000000 +0.649519052838329i )
$\theta _{268}^{-}=0.((001)^{88}0001)_{2}={\frac {67754913930863876636420964942226524366713408170066250043659752013773168429311121}{474284397516047136454946754595585670566993857190463750305618264096412179005177855}}$
$\theta _{268}^{+}=0.((001)^{88}0010)_{2}={\frac {67754913930863876636420964942226524366713408170066250043659752013773168429311122}{474284397516047136454946754595585670566993857190463750305618264096412179005177855}}$
One can analyze these angles using program by Claude Heiland-Allen :
Landing points of above rays are roots with angled internal addresses ( description by Claude Heiland-Allen) :
* the upper one will be 1 -> 1/3 -> 3 -> 1/(period/3) -> period because it's the nearest bulb to the lower root cusp of 1/3 bulb and child bulbs of 1/3 bulb have periods 3 * denominator(internal angle) ie, 1 -> 1/3 -> 3 -> 1/89 -> 267
* the lower one will be 1 -> floor(period/3)/period -> period because it's the nearest bulb below the 1/3 cusp ie, 1 -> 89/268 -> 268
* the middle ray .(001) lands at the root of 1 -> 1/3 -> 3, from the cusp on the lower side (which is on the right in a standard unrotated view)

### for gui program

To understand loading parameter files see deserialize function :

#### ray-out

Input format should be of the form:
e.g.:

## Gallery

commons category: Fractals created with mandelbrot-book program

# use

In the gui program box means that user have to mark rectangle ( like nucleus) not to click ( like bond)

# Dictionary
## bulb

* component
* Mu-Atom

## Bond

* touching point
* cur point
* root
In the book program result of computing bond is the internal angle ( = combinatorial rotation number ) of the parent components

## dwell

"Dwell is a colloquial name for the Representation Function called Escape-Iterations." From the Mandelbrot Set Glossary and Encyclopedia, by Robert Munafo, (c) 1987-2015.
"The dwell bands are the regions of solid color that appear in a standard view of the Mandelbrot Set; they are also called level sets. All points in a dwell band have the same dwell. They are separated from one another by the "contour lines" or lemniscates."

## hub

* branch type Misiurewicz point

## nucleus

Nucleus of a Mu-Atom = center of hyperbolic component of Mandelbrot set
Finding nucleus
A nucleus n of period p is a point of parameter plane
$c=n$
which satisfies :
$f_{n}^{p}(0)=0$
where :
$z=0$
Claude is using Newton's method in one variable to compute c=n

## Partials

* good guesses for the period of hyperbolic component (enclosed by atom domain) of c are the partials, namely the values of p for which |fpc(0)| reach a new minimum.
* the partials, namely the values of p for which |fpc(0)| reach a new minimum. It is related with the interior distance
* "partials" are the iterations p where |z_p| is smaller than all previous |z_n|. They are good candidates for possible periods.
* "Partials" is my term for the set of n with 0 < n such that |z_n| < |z_m| for all 0 < m < n, where z_{n+1} = z_n^2 + c, z_0 = 0. This is related to "atom period domain" colouring: http://mrob.com/pub/muency/atomdomain.html
* A different way is to check that z_p is near zero, rather than z_{p+1} is near c. They have the same effect in the end, but it's a little easier to calculate.
A few examples:
-9.82053364278e-2 + 0.87751161636 i is the center of a bulb with period 30 and approximate size 8.7e-4 its partials are 1 3 6 12 30
-1.40107054826248 + 1.68078322683058e-2 i is the center of a cardioid with period 25 and approximate size 2.9e-7 its partials are 1 2 4 8 25
-6.30751837180080329933379814864882594423413629277790243935409e-02 + 9.97813152226579778761450011018468925066022924931316287706002e-01 i is the center of a cardioid with period 660 and approximate size 1e-51 its partials are 1 3 4 5 12 34 133 660
-1.949583466095265215576424927006606703613013182307914337344552997126238598475224082315026579e+00 + -7.76868505224924928703440073040924718407938044210292978384443422263629366944037056031909997e-06 i is the center of a cardioid with period 1820 and approximate size 3.5e-83 its partials are 1 2 3 4 9 25 83 359 1820
Example output :

## final ...

* final_n = last iteration = n when z escapes
* final_z = last z
* final angle = angle of last z

## spoke

spoke = branch of the tree , arm of dendritic structure

### wucleus

Periodic point z = wucleus
A wucleus w of a point c within a hyperbolic component of period p satisfies :
where
so w is a point from dynamic plane ( z-plane)

# How to contribute ?

and send patch to Claude by e-mail.

# References

* ↑ c program by Claude Heiland-Allen
* ↑ Claude Heiland-Allen - blog
* ↑ An algorithm to draw external rays of the Mandelbrot set by Tomoki KAWAHIRA
* ↑ Interior coordinates in the Mandelbrot set
* ↑ Modified Atom Domains
* ↑ Mandelbrot Notebook
* ↑ book/code/gui/main.c
* ↑ mightymandel/src/atom.c code
* ↑ unofficial version ( with full c code ) of book "How to write a book about the Mandelbrot set" by by Claude Heiland-Allen
* ↑ Automatically finding external angles by Claude Heiland-Allen
* ↑ A Method to Solve the Limitations in Drawing External Rays of the Mandelbrot Set M. Romera,1 G. Pastor, A. B. Orue,1 A. Martin, M.-F. Danca,and F. Montoya
* ↑ Practical interior distance rendering by Claude Heiland-Allen