// dot product doubledot(complexdoublea,complexdoubleb){// ax*bx + ay*byreturncreal(a)*creal(b)+cimag(a)*cimag(b);}intInverseIterationAndDrawSegment(intper,complexdoublezz[per],unsignedcharA[]){intp;intpMax=per;complexdoublez;// compute preimagesfor(p=0;p<pMax;++p){z=zz[(p+1)%per];//read point from the ray p+1 z=csqrt(z-c);// inverse iteration = preimage; fc(z) maps z_{l,j} to z_{l-1,j+1}} so f^{-1} map to z_{l+1, j-1}// choose correct preimage using dot product if(dot(zz[p],z)<0)z=-z;// draw segment of ray pDrawClippedLineSegment(zz[p],z,255,A);zz[p]=z;//save }return0;}intDrawExternalDynamicRaysBI(intn,intm,intperiod,intiMax,unsignedcharA[]){inti=0;// iteration = number of pointsdoubler=10000.0;// very big radius = near infinity where z=w so one can swith to dynamical plane ( Boettcher conjugation )complexdoublezz[period];// zz is an array of z doublet;intp;intpMax=period;// number of rays to draw // initial points on pMax rayst=(double)n/m;// first external angle in turns for(p=0;p<pMax;++p){zz[p]=r*cexp(2.0*I*M_PI*t);// Euler's formula gives initial point on the p rayt*=2.0;// t = 2*t = angle doubling map ; gives next angle }for(i=0;i<iMax;++i)InverseIterationAndDrawSegment(period,zz,A);// inverse iteration of complex quadratic polynomial: with proper choose of preimage return0;}
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
to share – to copy, distribute and transmit the work
to remix – to adapt the work
Under the following conditions:
attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.