File:Besselj1mapT080.png

Complex map of function BesselJ1

$f=J_2(x+\mathrm i y)$ is shown in the $x,y$ plane with

levers $~u=\Re(f)=\mathrm{const}~ $ and

levers $~u=\Im(f)=\mathrm{const}~ $.

Implementation of BesselJ1
// The file below should be stored as besselj1.cin in the working directory

// BesselJ[1,z] implementation: z_type BesselJ1o(z_type z){ int n; z_type c,s,t; s=1.; c=1.; t=-z*z/4.; for(n=1;n<30;n++) {c/=0.+n*n; c*=t; s+=c/(1.+n);} return s*z/2.;}

z_type BesselJ1B(z_type z){ int n; z_type a,f,c,s,t,u,v; f=M_PI/4.+z; c=cos(f); s=sin(f); a=sqrt(2./M_PI/z); t=1./(z*z); u= (( (( (( (( ( 11587123363874217382000061956546875./302231454903657293676544.*t - 531595142508493798628972203125./1180591620717411303424.)*t + 61394155884765868567528125./9223372036854775808.)*t     -1149690375852815671875./9007199254740992.)*t + 232376754295310625./70368744177664.) * t          - 33424574007825./274877906944. ) * t             + 14783093325./2147483648. ) * t               - 2837835./4194304.      ) * t                  + 4725./32768. ) * t                  - 15./128.          ) *t -1. ; v= (((((((( ( - 38190914185478633427818266171875./9444732965739290427392.*t +3918391713821821611515765625./73786976294838206464.)*t -64152722972587114490625./72057594037927936.)*t   + 11100458801337530625./562949953421312.)*t - 1327867167401775./2199023255552. )*t         + 468131288625./17179869184.   )*t - 66891825./33554432.     )*t               + 72765./262144.        )*t - 105./1024.         )*t               + 3./8.             )/z; return (c*u+s*v)*a; }

z_type BesselJ1(z_type z){ DB x,y; x=Re(z)/12.6; y=Im(z)/18.5; if(x*x+y*y<1.) return BesselJ1o(z); if(x<0) return - BesselJ1B(-z); return  BesselJ1B(z); } // Copyleft 2012 by Dmitrii Kouznetsov. // The code above is supposed to return $J_1(z)$ with a dozen correct decimal digits for any complex(double) $z$

Generator of curves
File besselj1.cin above and files ado.cin and conto.cin should be loaded to the working directory in order to compile the C++ code below. The name besselj1map.cc is suggested for this code.

using namespace std; typedef complex z_type;
 * 1) include 
 * 2) include 
 * 3) define DB double
 * 4) define DO(x,y) for(x=0;x<y;x++)
 * 1) include
 * 1) define Re(x) x.real
 * 2) define Im(x) x.imag
 * 3) define I z_type(0.,1.)
 * 4) include "conto.cin"
 * 5) include "besselj1.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("besselj1map.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-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=-12;m<12;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<12;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<12;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<12;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<12;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=-11;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<12;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 besselj1map.eps"); system(   "open besselj1map.pdf"); getchar; system("killall Preview");//for mac } // Copyleft 2012 by Dmitrii Kouznetsov

Generator of labels
File besselj1map.pdf should be generated with the C++ code above and stored in the working directory; then the Latex document below (let it be stored as Besselj1mapT.tex ) can be compiled. \documentclass[12pt]{article} % \paperheight 838px % \paperwidth 1644px % \textwidth 1294px % \textheight 1200px % \topmargin -80px % \oddsidemargin -80px % \usepackage{graphics} % \usepackage{rotating} % \usepackage{color}% \newcommand \sx {\scalebox} % \newcommand \rot {\begin{rotate}} % \newcommand \ero {\end{rotate}} % \newcommand \ing {\includegraphics} % \newcommand \rmi {\mathrm{i}} % \begin{document} % \newcommand \zoomax { % \put(16,820){\sx{4.4}{$y$}} % \put(16,630){\sx{4}{$2$}} % \put(16,430){\sx{4}{$0$}} % \put(-4, 230){\sx{4}{$-\!2$}} % \put(220, 5){\sx{4}{$-\!6$}} % \put(420, 5){\sx{4}{$-\!4$}} % \put(620, 5){\sx{4}{$-\!2$}} % \put(843, 5){\sx{4}{$0$}} % \put(1043, 5){\sx{4}{$2$}} % \put(1243, 5){\sx{4}{$4$}} % \put(1443, 5){\sx{4}{$6$}} % \put(1631,6){\sx{4}{$x$}} % } % \parindent 0pt % \begin{picture}(1616,816) % %\put(40,30){\sx{10}{\ing{besselj1mapsmall}}} % \put(40,30){\sx{10}{\ing{besselj1map}}} % %\put(40,30){\sx{10}{\ing{10}}} % \zoomax % \put(270,430){\sx{4}{\rot{0}$v\!=\!0$\ero}} % \put(600,430){\sx{4}{\rot{0}$v\!=\!0$\ero}} % \put(990,430){\sx{4}{\rot{0}$v\!=\!0$\ero}} % \put(1340,430){\sx{4}{\rot{0}$v\!=\!0$\ero}} % \put(796,656){\sx{4}{\rot{0}$v\!=\!2$\ero}} % \put(440,602){\sx{4}{\rot{0}$v\!=\!-1$\ero}} \put(796,586){\sx{4}{\rot{0}$v\!=\!1$\ero}} % \put(450,262){\sx{4}{\rot{0}$v\!=\!1$\ero}} % \put(450,190){\sx{4}{\rot{0}$v\!=\!2$\ero}} %

\put(450,386){\sx{3}{\rot{0}$v\!=\!0.2$\ero}} \put(780,389){\sx{3}{\rot{0}$v\!=\!-0.2$\ero}}  % \put(450,344){\sx{3}{\rot{0}$v\!=\!0.4$\ero}} \put(780,356){\sx{3}{\rot{0}$v\!=\!-0.4$\ero}}  %

\put(161,480){\sx{4}{\rot{86}$u\!=\!0$\ero}} % \put(480,480){\sx{4}{\rot{80}$u\!=\!0$\ero}} % \put(770,452){\sx{3}{\rot{72}$u\!=\!-0.4$\ero}} %

\put(1064,534){\sx{3}{\rot{36}$u\!=\!0.8$\ero}} % \put(1080,482){\sx{3}{\rot{48}$u\!=\!0.6$\ero}} % \put(1142,452){\sx{3}{\rot{72}$u\!=\!0.4$\ero}} %

\put(865,472){\sx{4}{\rot{90}$u\!=\!0$\ero}} % \put(949,468){\sx{3}{\rot{109}$u\!=\!0.4$\ero}} % \put(1250,480){\sx{4}{\rot{99}$u\!=\!0$\ero}} % \put(1569,480){\sx{4}{\rot{95}$u\!=\!0$\ero}} % \end{picture} %\documentclass{beamer} % % \end{document} % %

%Copyleft 2012 by Dmitrii Kouznetsov

Generator of png
Unfortunately, wikimedia installed does not allow to load the PDF images. Therefore, the the besselj1mapT.pdf generated withe the code above is converted to the PNG format with resolution 80 pixels/inch.