File:Besselj0mapT100.png

Complex map of the Bessel function BesselJ0

$f=\mathrm{BesselJ}_0(x+\mathrm i y)$ is shown in the $x$,$y$ plane with lines $u\!=\!\Re(f)\!=\!\mathrm{const}$ and lines lines $v\!=\!\Im(f)\!=\!\mathrm{const}$.

C++ implementation of BesselJ0
// The file below should be stored in the working directory as besselj0.cin

z_type BesselJ0o(z_type z){ int n; z_type c,s,t; s=1.; c=1.; t=-z*z/4.; for(n=1;n<32;n++) {c/=0.+n*n; c*=t; s+=c;} return s;}

z_type BesselJ0B(z_type z){ int n; z_type c,C,s,S,t,u,x; t=M_PI/4.-z; c=cos(t); s=sin(t); u=1./16./(z*z); C=((((((((((( +  11021897833929133607268351617203125./137438953472.)*u -      502860269940467106811189921875./8589934592.)*u +          57673297952355815927071875./1073741824.)*u -            1070401384414690453125./16777216.)*u  +                213786613951685775./2097152.)*u -                  30241281245175./131072.)*u  +                     13043905875./16384.)*u -                       2401245./512.)*u  +                          3675./64.)* u  -                            9./4.)*u + 2.)* c; S=((((((((((( -   882276678992136837800861860405640625./274877906944.)*u +     36232405765710498380237842265625./17179869184.)*u -         3694483615889146090857721875./2147483648.)*u +            60013837619516978071875./33554432.)*u  -               10278202593831046875./4194304.)*u +                 1212400457192925./262144.)*u -                     418854310875./32768.)*u +                       57972915./1024.)*u -                          59535./128.)*u +                           75./8.)*u - 1.) *s/4./z; return (C+S)/sqrt(2.*M_PI*z);}

z_type BesselJ0(z_type z){ if(Re(z)<0.) z=-z; DB x=(Re(z)-2.)/12.; DB y=Im(z)/19.; if(x*x+y*y<1.) return BesselJ0o(z); return BesselJ0B(z); }

// The function BesselJ0 returns of order of a dozen of correct decimal digits.

C++ generator of curves
// Fies besselj0.cin above and conto.cin should be stored in the working directory in order to compile the code below.

using namespace std; typedef complex z_type; // z_type BesselJ0o(z_type z){ int n; z_type c,s,t; s=1.; c=1.; // t=-z*z/4.; for(n=1;n<12;n++) {c/=0.+n*n; c*=t; s+=c;} return s;}
 * 1) include 
 * 2) include 
 * 3) include 
 * 4) define DB double
 * 5) 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 "besselj0.cin"

main{ int j,k,m,n; DB x,y, p,q, t; z_type z,c,d; int M=401,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("besselj0map.eps","w");ado(o,82,82); fprintf(o,"41 41 translate\n 10 10 scale\n"); DO(n,200)Y[n]=-4.+.02*n; Y[200]=-.002; Y[201]= .002; for(n=202;n-99. && p<99.       &&     q>-99. && q<99        ) {g[m*N1+n]=p; f[m*N1+n]=q; }                      }} // Draw the contours: // #include "plodi.cin" #include "plofu.cin" fprintf(o,"showpage\n%c%cTrailer",'%','%'); fclose(o); system("epstopdf besselj0map.eps"); system(   "open besselj0map.pdf"); getchar; system("killall Preview");//for mac }

Latex generator of labels
% File acoscmap.pdf should be generated with the code above in order to compile the latex document below: % \documentclass[12pt]{article} % \paperheight 838px % \paperwidth 844px % \textwidth 1294px % \textheight 1200px % \topmargin -80px % \oddsidemargin -80px % \usepackage{graphics} % \usepackage{rotating} % \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}{$-\!2$}} % \put(443, 5){\sx{4}{$0$}} % \put(643, 5){\sx{4}{$2$}} % \put(831,6){\sx{4}{$x$}} % } % \parindent 0pt % %\sx{8}{\begin{picture}(86,86) \put(0,0){\ing{b271t0}} % \begin{picture}(816,816) % \put(40,30){\sx{10}{\ing{besselj0map}}} % \zoomax % \put(463,490){\sx{4}{\rot{90}$v\!=\!0$\ero}} % \put(463,320){\sx{4}{\rot{90}$v\!=\!0$\ero}} % \put(80,484){\sx{4}{\rot{86}$v\!=\!0$\ero}} % \put(222,469){\sx{4}{\rot{77}$u\!=\!0$\ero}} % \put(498,470){\sx{4}{\rot{49}$u\!=\!1$\ero}} % \put(470,411){\sx{4}{\rot{-50}$u\!=\!1$\ero}} % \put(480,430){\sx{4}{$v\!=\!0$}} % \put(231,463){\sx{3.8}{\rot{1}$v\!=\!0.2$\ero}} % \put(230,431){\sx{3.8}{$v\!=\!0$}} % \put(226,399){\sx{3.8}{\rot{-5}$v\!=\!-0.2$\ero}} % \end{picture} % \end{document} % %