List of all roots between period 1 and period 987 components

`Root point between period 1 component and period 987 component = c = 0.2500101310666710+0.0000000644946597*I Internal angle (c) = 1/987`

Root point between period 1 component and period 987 component = c = 0.2500405213927559+0.0000005159415960*I Internal angle (c) = 2/987

Root point between period 1 component and period 987 component = c = 0.2501620395922977+0.0000041270309808*I Internal angle (c) = 4/987

... The message exceeds the maximum allowed length (80000 characters).

and the program

`/*`

gcc c.c -lm -Wall

./a.out

Root point between period 1 component and period 987 component = c = 0.2500101310666710+0.0000000644946597

Internal angle (c) = 1/987

Internal radius (c) = 1.0000000000000000

*/

#include <stdio.h>

#include <math.h> // M_PI; needs -lm also

#include <complex.h>

// numer of hyberolic components ( and it's centers ) of Mandelbrot set

int GiveNumberOfCenters(int period){

//int s = 0;

int num = 1;

int f;

int fMax = period-1; //sqrt(period); // https://stackoverflow.com/questions/11699324/algorithm-to-find-all-the-exact-divisors-of-a-given-integer

if (period<1 ) {printf("input error: period should be positive integer \n"); return -1;}

if (period==1) { return 1;}

num = pow(2, period-1);

// minus sum of number of center of all it's divisors (factors)

for (f=1; f<= fMax; ++f){

if (period % f==0)

{num = num - GiveNumberOfCenters(f); }

}

return num ;

}

int ListNumberOfCenters(int period){

int p=1;

int pMax = period;

int num=0;

if (period ==1 || period==2) {printf (" for period %d there is only one component\n", period); return 0;}

for (p=1; p<= pMax; ++p){

num = GiveNumberOfCenters(p);

printf (" for period %d there are %d components\n", p, num);

}

return 0;

}

/*

c functions using complex type numbers computes c from component of Mandelbrot set

input:

Period : positive integer

n<d

InternalRadius in [0.0, 1.0]

*/

complex double Give_c( int Period, int n, int d , double InternalRadius )

{

complex double c;

complex double w; // point of reference plane where image of the component is a unit disk

// alfa = ax +ay*i = (1-sqrt(d))/2 ; // result

double t; // InternalAngleInTurns

if (Period<1 )

{printf("input error: period should be positive integer \n"); return 10000.0;}

t = (double) n/d;

t = t * M_PI * 2.0; // from turns to radians

w = InternalRadius*cexp(I*t); // map to the unit disk

switch ( Period ) // of component

{

case 1: // main cardioid = only one period 1 component

c = w/2 - w*w/4; // https://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/Mandelbrot_set/boundary#Solving_system_of_equation_for_period_1

break;

case 2: // only one period 2 component

c = (w-4)/4 ; // https://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/Mandelbrot_set/boundary#Solving_system_of_equation_for_period_2

break;

default: // period > 2

printf("period = %d ; for higher periods : not works now, to do, use newton method \n", Period);

printf("for each Period >2 there are more then 1 components.\nHere are 2^(p-1) - s = %d components for period %d\n", GiveNumberOfCenters(Period), Period);

printf("to choose component use: it's center or external ray or angled internal address \n");

c = 10000.0; // bad value

break; }

return c;

}

void PrintAndDescribe_c( int period, int n, int d , double InternalRadius ){

complex double c = Give_c(period, n, d, InternalRadius);

printf("Root point between period %d component and period %d component = c = %.16f%+.16f*I\t",period, d, creal(c), cimag(c));

//printf("Internal radius (c) = %.16f\n",InternalRadius);

printf("Internal angle (c) = %d/%d\n",n, d);

}

/*

https://stackoverflow.com/questions/19738919/gcd-function-for-c

The GCD function uses Euclid's Algorithm.

It computes A mod B, then swaps A and B with an XOR swap.

*/

int gcd(int a, int b)

{

int temp;

while (b != 0)

{

temp = a % b;

a = b;

b = temp;

}

return a;

}

int ListAllBifurcationPoints(int period, int d ){

double InternalRadius = 1.0;

// internal angle in turns as a ratio = n/d

int n = 1;

//int d = 987;

if (period<1 )

{printf("input error: period should be positive integer \n"); return 1;}

if (period >2)

{printf("input error: not works now. TODO \n"); return 2;}

// n/d = local angle in turns

for (n = 1; n < d; ++n ){

if (gcd(n,d)==1 )// irreducible fraction

{ PrintAndDescribe_c(period, n,d,InternalRadius); }

}

return 0;

}

int main (){

int period = 1;

double InternalRadius = 1.0;

// internal angle in turns as a ratio = p/q

int n = 1;

int d = 987;

complex double c;

//c = Give_c(period, n,d , InternalRadius);

//PrintAndDescribe_c(period, n,d , InternalRadius);

ListAllBifurcationPoints(period,d);

//ListNumberOfCenters(period);

return 0;

}