Contour plot/Code/AnalyticTetrationBaseSqrt2u00

From Citizendium
Jump to navigation Jump to search

// AnalyticTetrationBaseSqrt2u00.png // (click at the figure to see the description)
// In order to generate the figure above, you need the plotter routines
// ContourPlot/code/ado.cin , which makes the header of the eps file, and
// ContourPlot/code/conto.cin, witch draws there the contour lines.
// With these routines, you may compile and execute the source below
//
// Copyleft 2008 by Dmitrii Kouznetsov
//
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
#include <complex.h>
#define z_type complex<double>
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
#include "conto.cin"
main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d, cu,cd;
int M=300,M1=M+1;
int N=300,N1=N+1;
                                                                            
int K=15;
x=K;
DB Q=0.32663425997828098240;
DB R=0;
                                                                            
DB X[M1],Y[N1], g[M1*N1],f[M1*N1], w[M1*N1]; // w is working array.
char v[M1*N1]; // v is working array
 printf("Output  sqrt2b.eps copyleft 2008 by Dmitrii Kouznetsov\n");
FILE *o;o=fopen("sqrt2b.eps","w");ado(o,0,0,304,404);
fprintf(o,"152 202 translate\n 10 10 scale\n");
                                                                            
DB sy=20./(N/2.);
DO(m,M1) X[m]=-15+.1*m;
DO(n,N1) Y[n]=sy*(n-N/2.+.5);
                                                                            
for(m=-10;m<11;m++) {M(m,-10)L(m,10)}
for(n=-10;n<11;n++) {M(  -10,n)L(10,n)} fprintf(o,".006 W 0 0 0 RGB S\n");
                                                                            
fprintf(o,"/adobe-Roman findfont 1 scalefont setfont\n");
for(m=-8;m<0;m+=2) {M(-11.2,m-.3) fprintf(o,"(%1d)s\n",m);}
for(m=0;m<9;m+=2) {M(-10.7,m-.3) fprintf(o,"(%1d)s\n",m);}
                                                                            
for(m=-8;m<0;m+=4) {M(m-.6,-10.8) fprintf(o,"(%1d)s\n",m);}
for(m= 0;m<9;m+=4) {M(m-.3,-10.8) fprintf(o,"(%1d)s\n",m);}
                                                                            
fprintf(o,"/Times-Italic findfont 1 scalefont setfont\n");
M(-10.7,  9.5) fprintf(o,"(y)s\n");
M(  9.6,-10.8) fprintf(o,"(x)s\n");
                                                                                                                                                        
M(-11,0)L(11,0)
M(0,-19)L(0,19) fprintf(o,".01 W 1 0 1 RGB S\n");
                                                                            
z_type tm,tp,F[M1*N1];;
                                                                            
DO(m,M1)DO(n,N1){
                       g[m*N1+n]=9999;
                       f[m*N1+n]=9999;
               }
for(m=0;m<10;m++){     x=X[m]; int m1;
                       DO(n,N1){y=Y[n]; z=z_type(x,y);
                               c=4.+exp(Q*z+R);
                               m1=m;
                               for(;m1<M1;){   F[m1*N1+n]=c; p=Re(c); q=Im($                                                if(p>-999 && p<999) g[m1*N1+$                                                if(q>-999 && q<999) f[m1*N1+$                                                c=exp(log(sqrt(2.))*c); m1+=$                                            }
                               }
               }
p=.8;
q=6;

                  conto(o,f,w,v,X,Y,M,N, (-8.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-7.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-6.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-5.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-4.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, (-4.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-3.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, (-3.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-2.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, (-2.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (-1.     ),-q,q); fprintf(o,".05 W 1 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, (-1.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, (0.      ),-5,5); fprintf(o,".04 W 0 .5 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, (    .1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 1.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, ( 1.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 2.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, ( 2.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 3.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N, ( 3.+.1*n),-p,p); fprintf(o,".01 W 0 1 0 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 4.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 5.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 6.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 7.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
                  conto(o,f,w,v,X,Y,M,N, ( 8.     ),-q,q); fprintf(o,".05 W 0 0 1 RGB S\n");
                                                                                                                 
                  conto(o,g,w,v,X,Y,M,N, (-2.     ),-99,99); fprintf(o,".04 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (-2.+.1*n),-p,p); fprintf(o,".01 W 1 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, (-1.     ),-9,9); fprintf(o,".04 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (-1.+.1*n),-p,p); fprintf(o,".006 W 1 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, (0.      ),-99,99); fprintf(o,".03 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (    .1*n),-p,p); fprintf(o,".006 W 0 0 1 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 1.     ),-9,9); fprintf(o,".03 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, ( 1.+.1*n),-p,p); fprintf(o,".006 W 0 0 1 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 2.     ),-9,9); fprintf(o,".03 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, ( 2.+.1*n),-p,p); fprintf(o,".01 W 0 0 1 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 3.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, ( 3.+.1*n),-p,p); fprintf(o,".01 W 0 0 1 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 4.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, ( 4.+.1*n),-p,p); fprintf(o,".01 W 0 0 1 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 5.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 6.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 7.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, ( 8.     ),-9,9); fprintf(o,".05 W 0 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, (16.     ),-99,99); fprintf(o,".05 W 0 0 0 RGB S\n");
                  conto(o,g,w,v,X,Y,M,N, (32.     ),-999,999); fprintf(o,".05 W 0 0 0 RGB S\n");
                                                                                                                 
//M(-10,0)L(-2,0)fprintf(o,".04 W 1 0 1 RGB S\n");
//fprintf(o,"showpage\n\%\%\%Trailer"); fclose(o);
//system( "ggv sqrt2b.eps");
//  system("open sqrt2b.eps");
//system("ps2pdf sqrt2b.eps");
//getchar(); system("killall Preview");
}
// end of program