File:LogTestMapTORI.jpg

From TORI
Jump to navigation Jump to search

LogTestMapTORI.jpg(468 × 468 pixels, file size: 106 KB, MIME type: image/jpeg)

Summary


Complex map of function \( z\mapsto \ln(z) \)

generated at the poor resolution grid with routine conto.cin from Citizendium [1]

The picture is loaded with goal to compare it to that generated with Second vision of the similar routine written by ChatGPT 2025.08.29.

C++ generator

// Files ado.cin and conto.cin should be loaded in order to compile the code below.

#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
#include<complex>
typedef std::complex<double> z_type;
#define Re(x) x.real()
#define Im(x) x.imag()
#define I z_type(0.,1.)
#include "conto.cin"

z_type F(z_type z) {return log(z);}

int main(){ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d, cu,cd;
int M=41,M1=M+1;
int N=41,N1=N+1;
DB X[M1],Y[N1]; DB *g, *f, *w; // w is working array.
g=(DB *)malloc((size_t)((M1*N1)*sizeof(DB)));
f=(DB *)malloc((size_t)((M1*N1)*sizeof(DB)));
w=(DB *)malloc((size_t)((M1*N1)*sizeof(DB)));
char v[M1*N1]; // v is working array
//FILE *o;o=fopen("QuadraticMapByTORItest11.eps","w");  ado(o,422,422);
FILE *o;o=fopen("LogTestMapTORI.eps","w");  ado(o,422,422);
fprintf(o,"210 210 translate\n 100 100 scale\n");
fprintf(o,"1 setlinejoin 2 setlinecap\n");

//fprintf(o,"/W { setlinewidth } def\n");
//fprintf(o,"/RGB { setrgbcolor } def\n");
//fprintf(o,"/S { stroke } def\n");
//#define M(x,y) fprintf(o,"%6.3f %6.3f M\n",0.+x,0.+y); 
//#define L(x,y) fprintf(o,"%6.3f %6.3f L\n",0.+x,0.+y); 
DO(m,M1) X[m]=-2+.1*(m-.4);
DO(n,N1) Y[n]=-2+.1*(n-.3); 
for(m=-2;m<3;m++){M(m,-2) L(m,2)}
for(n=-2;n<3;n++){M(-2,n) L(2,n)}
 fprintf(o,".01 W 0 0 0 RGB S\n");
DO(m,M1)DO(n,N1){      g[m*N1+n]=999;
                       f[m*N1+n]=999;}
DO(m,M1){x=X[m]; if(m/10*10==m) printf("x=%6.3f\n",x);
DO(n,N1){y=Y[n]; z=z_type(x,y); //if(abs(z+2.)>.019)
  c=F(z);
 p=Re(c); q=Im(c); if(p>-99 && p<99 ){ g[m*N1+n]=p;f[m*N1+n]=q;}
       }}
fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=1.5;q=1.5;

for(m=-3;m<3;m++)for(n=2;n<10;n+=2)conto(o,f,w,v,X,Y,M,N,(m+.1*n),-q,q);
fprintf(o,".01 W 0 .6 0 RGB S\n"); 

for(m=0;m<2;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N,-(m+.1*n),-q,q);
fprintf(o,".01 W .8 0 0 RGB S\n"); 

for(m=0;m<2;m++) for(n=2;n<10;n+=2)conto(o,g,w,v,X,Y,M,N, (m+.1*n),-q,q);
fprintf(o,".01 W 0 0 .8 RGB S\n"); 

for(m= 1;m<5;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); 
fprintf(o,".02 W 0 0 .8 RGB S\n"); 

for(m= 1;m<5;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p);
fprintf(o,".02 W .8 0 0 RGB S\n"); 

                   conto(o,f,w,v,X,Y,M,N, (0.  ),-p,p);
fprintf(o,".02 W .5 0 .5 RGB S\n");

for(m=-4;m<5;m++)conto(o,g,w,v,X,Y,M,N,(0.+m),-p,p);
fprintf(o,".02 W 0 0 0 RGB S\n"); 

fprintf(o,"showpage\n"); fprintf(o,"%c%cTrailer\n",'%','%');
fclose(o);  free(f); free(g); free(w);
      system("epstopdf LogTestMapTORI.eps"); 
      system(    "open LogTestMapTORI.pdf"); //for macintosh
}

References

  1. https://en.citizendium.org/wiki/Contour_plot/Code/conto.cin // Copyleft 2008 by Dmitrii Kouznetsov This page was last modified 01:05, 2 February 2009.

Keywords

«Ado.cin», «Conto.cin», «Contour plot», «Log», «LogTestMaps‎‎», «ContoTestMaps»,

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:29, 1 September 2025Thumbnail for version as of 18:29, 1 September 2025468 × 468 (106 KB)T (talk | contribs)== Summary == {{oq|LogTestMapTORI.jpg|LogTestMapTORI.jpg ‎(468 × 468 pixels, file size: 106 KB, MIME type: image/jpeg) }} Complex map of function \( z\mapsto \ln(z) \) generated at the poor resolution grid with routine conto.cin from Citizendium <ref> https://en.citizendium.org/wiki/Contour_plot/Code/conto.cin // Copyleft 2008 by Dmitrii Kouznetsov This page was last modified 01:05, 2 February 2009. </ref> The picture is loaded with goal to compare it to that generated with Second vis...

The following page uses this file:

Metadata