Difference between revisions of "File:CoscmapT100.png"

From TORI
Jump to navigation Jump to search
(Importing image file)
 
 
Line 1: Line 1:
  +
[[Complex map]] of function [[Cosc]].
Importing image file
 
  +
  +
$ u+\mathrm i v= \mathrm{cosc}(x+\mathrm i y)$
  +
  +
==C++ generator of curves==
  +
Files [[conto.cin]] and [[ado.cin]]
  +
should be loaded to the working directory in order to compile the [[C++]] code below.
  +
  +
#include <stdio.h>
  +
#include <stdlib.h>
  +
#define DB double
  +
#define DO(x,y) for(x=0;x<y;x++)
  +
using namespace std;
  +
#include <complex>
  +
typedef complex<double> z_type;
  +
#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;
  +
int M=801,M1=M+1;
  +
int N=401,N1=N+1;
  +
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
  +
FILE *o;o=fopen("coscmap.eps","w");ado(o,162,82);
  +
fprintf(o,"81 41 translate\n 10 10 scale\n");
  +
DO(m,400) X[m]=-8.+.02*m;
  +
X[400]=-.001;
  +
X[401]= .001;
  +
for(m=402;m<M1;m++) X[m]=-8.+.02*(m-1.);
  +
DO(n,200)Y[n]=-4.+.02*n;
  +
Y[200]=-.001;
  +
Y[201]= .001;
  +
for(n=202;n<N1;n++) Y[n]=-4.+.02*(n-1.);
  +
//DO(m,M1)X[m]=Y[m];
  +
for(m=-8;m<9;m++){if(m==0){M(m,-4.1)L(m,4.1)} else{M(m,-4)L(m,4)}}
  +
for(n=-4;n<5;n++){ M( -8,n)L(8,n)}
  +
fprintf(o,".01 W 0 0 0 RGB S\n");
  +
DO(m,M1)DO(n,N1){g[m*N1+n]=9999; f[m*N1+n]=9999;}
  +
DO(m,M1){x=X[m]; //printf("%5.2f\n",x);
  +
DO(n,N1){y=Y[n]; z=z_type(x,y);
  +
c=cos(z)/z;
  +
p=Re(c); q=Im(c);
  +
if(p>-99. && p<99.
  +
&& q>-99. && q<99
  +
)
  +
{g[m*N1+n]=p;
  +
f[m*N1+n]=q;
  +
}
  +
}}
  +
//#include "plodi.cin"
  +
fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=1.5;q=.5;
  +
for(m=-11;m<11;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<10;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 .9 0 0 RGB S\n");
  +
for(m=0;m<10;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 .9 RGB S\n");
  +
for(m=1;m<11;m++) conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".02 W .9 0 0 RGB S\n");
  +
for(m=1;m<11;m++) conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 .9 RGB S\n");
  +
conto(o,f,w,v,X,Y,M,N, (0. ),-2*p,2*p); fprintf(o,".02 W .6 0 .6 RGB S\n");
  +
for(m=-9;m<0;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
m=0; conto(o,g,w,v,X,Y,M,N, (0.+m),-2*p,2*p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
for(m=1;m<10;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
  +
//#include "plofu.cin"
  +
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
  +
system("epstopdf coscmap.eps");
  +
system( "open coscmap.pdf");
  +
getchar(); system("killall Preview");//for mac
  +
}
  +
  +
==Latex generator of labels==
  +
File [[coscmap.pdf]] should be generated with the code above in order to compile the [[Lattex]] document below.
  +
  +
%<nowiki><br>
  +
\documentclass[12pt]{article} %<br>
  +
\paperheight 838px %<br>
  +
\paperwidth 1644px %<br>
  +
\textwidth 1294px %<br>
  +
\textheight 1200px %<br>
  +
\topmargin -80px %<br>
  +
\oddsidemargin -80px %<br>
  +
\usepackage{graphics} %<br>
  +
\usepackage{rotating} %<br>
  +
\newcommand \sx {\scalebox} %<br>
  +
\newcommand \rot {\begin{rotate}} %<br>
  +
\newcommand \ero {\end{rotate}} %<br>
  +
\newcommand \ing {\includegraphics} %<br>
  +
\newcommand \rmi {\mathrm{i}} %<br>
  +
\begin{document} %<br>
  +
\newcommand \zoomax { %<br>
  +
\put(16,820){\sx{4.4}{$y$}} %<br>
  +
\put(16,630){\sx{4}{$2$}} %<br>
  +
\put(16,430){\sx{4}{$0$}} %<br>
  +
\put(-4, 230){\sx{4}{$-\!2$}} %<br>
  +
\put(220, 5){\sx{4}{$-\!6$}} %<br>
  +
\put(420, 5){\sx{4}{$-\!4$}} %<br>
  +
\put(620, 5){\sx{4}{$-\!2$}} %<br>
  +
\put(843, 5){\sx{4}{$0$}} %<br>
  +
\put(1043, 5){\sx{4}{$2$}} %<br>
  +
\put(1243, 5){\sx{4}{$4$}} %<br>
  +
\put(1443, 5){\sx{4}{$6$}} %<br>
  +
\put(1631,6){\sx{4}{$x$}} %<br>
  +
} %<br>
  +
\parindent 0pt %<br>
  +
\begin{picture}(1616,816) %<br>
  +
\put(40,30){\sx{10}{\ing{coscmap}}} %<br>
  +
\zoomax %<br>
  +
\put(800,650){\sx{3}{$v\!=\!-2$}} %<br>
  +
\put(850,533){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
%<br>
  +
\put(120,432){\sx{4}{\rot{0}$v\!=\!0$\ero}} %<br>
  +
\put(480,432){\sx{3}{\rot{0}$v\!=\!0$\ero}} %<br>
  +
\put(577,402){\sx{3}{\rot{90}$v\!=\!0$\ero}} %<br>
  +
\put(100,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(250,390){\sx{4}{\rot{90}$v\!=\!0$\ero}} %<br>
  +
\put(380,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(470,390){\sx{3}{\rot{90}$u\!=\!0.2$\ero}} %<br>
  +
\put(1250,380){\sx{3}{\rot{90}$u\!=\!-0.2$\ero}} %<br>
  +
\put(1350,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(1490,390){\sx{4}{\rot{90}$v\!=\!0$\ero}} %<br>
  +
\put(1640,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(700,400){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(1026,406){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br>
  +
\put(1130,406){\sx{3}{\rot{90}$v\!=\!0$\ero}} %<br>
  +
\put(1360,431){\sx{4}{\rot{00}$v\!=\!0$\ero}} %<br>
  +
%<br>
  +
\put(720,260){\sx{3}{\rot{60}$v\!=\!1$\ero}} %<br>
  +
\put(1000,256){\sx{3}{\rot{5}$u\!=\!-1$\ero}} %<br>
  +
%<br>
  +
\put(644,414){\sx{3}{\rot{-47}$u\!=\!0.2$\ero}} %<br>
  +
\put(610,370){\sx{3}{\rot{-32}$u\!=\!0.4$\ero}} %<br>
  +
\put(610,270){\sx{3}{\rot{-5}$u\!=\!1$\ero}} %<br>
  +
\put(810,230){\sx{3}{$v\!=\!2$}} %<br>
  +
\put(810,160){\sx{3}{$v\!=\!3$}} %<br>
  +
%<br>
  +
\put(1200,610){\sx{3.3}{$v\!=\!0.6$}} %<br>
  +
\put(1200,560){\sx{3.3}{$v\!=\!0.4$}} %<br>
  +
\put(1200,510){\sx{3.3}{$v\!=\!0.2$}} %<br>
  +
\put(1200,350){\sx{3.3}{$v\!=\!-0.2$}} %<br>
  +
\put(1200,290){\sx{3.3}{$v\!=\!-0.4$}} %<br>
  +
%<br>
  +
\put(1200,210){\sx{3.3}{$v\!=\!-1$}} %<br>
  +
\put(1200,130){\sx{3.3}{$v\!=\!-2$}} %<br>
  +
\end{picture} %<br>
  +
\end{document} %<br>
  +
%</nowiki>
  +
  +
==Conversion==
  +
PDF generated with latex is converted to [[PNG]] with resolution 100px/inch.
  +
  +
[[Category:Cosc]]
  +
[[Category:Complex map]]
  +
[[Category:Elementary function]]
  +
[[Category:Guiding of waves between absorbing walls]]

Latest revision as of 09:41, 21 June 2013

Complex map of function Cosc.

$ u+\mathrm i v= \mathrm{cosc}(x+\mathrm i y)$

C++ generator of curves

Files conto.cin and ado.cin should be loaded to the working directory in order to compile the C++ code below.

#include <stdio.h>
#include <stdlib.h>
#define DB double
#define DO(x,y) for(x=0;x<y;x++)
using namespace std;
#include <complex>
typedef complex<double> z_type;
#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;
int M=801,M1=M+1;
int N=401,N1=N+1;
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
FILE *o;o=fopen("coscmap.eps","w");ado(o,162,82);
fprintf(o,"81 41 translate\n 10 10 scale\n"); 
DO(m,400) X[m]=-8.+.02*m;
     X[400]=-.001;
     X[401]= .001;
for(m=402;m<M1;m++) X[m]=-8.+.02*(m-1.);
DO(n,200)Y[n]=-4.+.02*n;
      Y[200]=-.001;
      Y[201]= .001;
for(n=202;n<N1;n++) Y[n]=-4.+.02*(n-1.);
//DO(m,M1)X[m]=Y[m];
for(m=-8;m<9;m++){if(m==0){M(m,-4.1)L(m,4.1)} else{M(m,-4)L(m,4)}}
for(n=-4;n<5;n++){     M(  -8,n)L(8,n)}
fprintf(o,".01 W 0 0 0 RGB S\n");
DO(m,M1)DO(n,N1){g[m*N1+n]=9999; f[m*N1+n]=9999;}
DO(m,M1){x=X[m]; //printf("%5.2f\n",x);
DO(n,N1){y=Y[n]; z=z_type(x,y);
      c=cos(z)/z;
     p=Re(c);    q=Im(c);        
     if(p>-99. && p<99.
      &&     q>-99. && q<99 
     )
{g[m*N1+n]=p; 
 f[m*N1+n]=q;
}
                     }}
//#include "plodi.cin"
fprintf(o,"1 setlinejoin 1 setlinecap\n"); p=1.5;q=.5;
for(m=-11;m<11;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<10;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 .9 0 0 RGB S\n");
for(m=0;m<10;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 .9 RGB S\n");
for(m=1;m<11;m++)  conto(o,f,w,v,X,Y,M,N, (0.-m),-p,p); fprintf(o,".02 W .9 0 0 RGB S\n");
for(m=1;m<11;m++)  conto(o,f,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 .9 RGB S\n");
                conto(o,f,w,v,X,Y,M,N, (0.  ),-2*p,2*p); fprintf(o,".02 W .6 0 .6 RGB S\n");
for(m=-9;m<0;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
    m=0;          conto(o,g,w,v,X,Y,M,N, (0.+m),-2*p,2*p); fprintf(o,".02 W 0 0 0 RGB S\n");
for(m=1;m<10;m++) conto(o,g,w,v,X,Y,M,N, (0.+m),-p,p); fprintf(o,".02 W 0 0 0 RGB S\n");
//#include "plofu.cin"
fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o);
     system("epstopdf coscmap.eps");
     system(    "open coscmap.pdf");            
     getchar(); system("killall Preview");//for mac
}

Latex generator of labels

File coscmap.pdf should be generated with the code above in order to compile the Lattex document below.

%<br> \documentclass[12pt]{article} %<br> \paperheight 838px %<br> \paperwidth 1644px %<br> \textwidth 1294px %<br> \textheight 1200px %<br> \topmargin -80px %<br> \oddsidemargin -80px %<br> \usepackage{graphics} %<br> \usepackage{rotating} %<br> \newcommand \sx {\scalebox} %<br> \newcommand \rot {\begin{rotate}} %<br> \newcommand \ero {\end{rotate}} %<br> \newcommand \ing {\includegraphics} %<br> \newcommand \rmi {\mathrm{i}} %<br> \begin{document} %<br> \newcommand \zoomax { %<br> \put(16,820){\sx{4.4}{$y$}} %<br> \put(16,630){\sx{4}{$2$}} %<br> \put(16,430){\sx{4}{$0$}} %<br> \put(-4, 230){\sx{4}{$-\!2$}} %<br> \put(220, 5){\sx{4}{$-\!6$}} %<br> \put(420, 5){\sx{4}{$-\!4$}} %<br> \put(620, 5){\sx{4}{$-\!2$}} %<br> \put(843, 5){\sx{4}{$0$}} %<br> \put(1043, 5){\sx{4}{$2$}} %<br> \put(1243, 5){\sx{4}{$4$}} %<br> \put(1443, 5){\sx{4}{$6$}} %<br> \put(1631,6){\sx{4}{$x$}} %<br> } %<br> \parindent 0pt %<br> \begin{picture}(1616,816) %<br> \put(40,30){\sx{10}{\ing{coscmap}}} %<br> \zoomax %<br> \put(800,650){\sx{3}{$v\!=\!-2$}} %<br> \put(850,533){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br> %<br> \put(120,432){\sx{4}{\rot{0}$v\!=\!0$\ero}} %<br> \put(480,432){\sx{3}{\rot{0}$v\!=\!0$\ero}} %<br> \put(577,402){\sx{3}{\rot{90}$v\!=\!0$\ero}} %<br> \put(100,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br> \put(250,390){\sx{4}{\rot{90}$v\!=\!0$\ero}} %<br> \put(380,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br> \put(470,390){\sx{3}{\rot{90}$u\!=\!0.2$\ero}} %<br> \put(1250,380){\sx{3}{\rot{90}$u\!=\!-0.2$\ero}} %<br> \put(1350,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br> \put(1490,390){\sx{4}{\rot{90}$v\!=\!0$\ero}} %<br> \put(1640,390){\sx{4}{\rot{90}$u\!=\!0$\ero}} %<br> \put(700,400){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br> \put(1026,406){\sx{3}{\rot{90}$u\!=\!0$\ero}} %<br> \put(1130,406){\sx{3}{\rot{90}$v\!=\!0$\ero}} %<br> \put(1360,431){\sx{4}{\rot{00}$v\!=\!0$\ero}} %<br> %<br> \put(720,260){\sx{3}{\rot{60}$v\!=\!1$\ero}} %<br> \put(1000,256){\sx{3}{\rot{5}$u\!=\!-1$\ero}} %<br> %<br> \put(644,414){\sx{3}{\rot{-47}$u\!=\!0.2$\ero}} %<br> \put(610,370){\sx{3}{\rot{-32}$u\!=\!0.4$\ero}} %<br> \put(610,270){\sx{3}{\rot{-5}$u\!=\!1$\ero}} %<br> \put(810,230){\sx{3}{$v\!=\!2$}} %<br> \put(810,160){\sx{3}{$v\!=\!3$}} %<br> %<br> \put(1200,610){\sx{3.3}{$v\!=\!0.6$}} %<br> \put(1200,560){\sx{3.3}{$v\!=\!0.4$}} %<br> \put(1200,510){\sx{3.3}{$v\!=\!0.2$}} %<br> \put(1200,350){\sx{3.3}{$v\!=\!-0.2$}} %<br> \put(1200,290){\sx{3.3}{$v\!=\!-0.4$}} %<br> %<br> \put(1200,210){\sx{3.3}{$v\!=\!-1$}} %<br> \put(1200,130){\sx{3.3}{$v\!=\!-2$}} %<br> \end{picture} %<br> \end{document} %<br> %

Conversion

PDF generated with latex is converted to PNG with resolution 100px/inch.

File history

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

Date/TimeThumbnailDimensionsUserComment
current17:50, 20 June 2013Thumbnail for version as of 17:50, 20 June 20132,284 × 1,164 (1.75 MB)Maintenance script (talk | contribs)Importing image file

The following page uses this file:

Metadata