Plots of complex functions



Hello,

> I've always admired the classic Jahnke-Emde 3d plots of complex
> functions made by hand in the early 20th century.  They overlay the
> contours of the absolute value and the complex argument on top of a 3d
> plot -- as seen in the attached plot of the gamma function.  They also
> did a superb job of clear labelling.... 

> Which of the plotting packages compatible with Maxima can do this, and
> what are the necessary options?

After playing for a while, I arrived to the following code. I would
prefere a nicer plot, but the treatment of the poles is something to be
improved:

load(draw)$ /* current cvs version in share/draw */
gamma2(x,y):=
   block([re,im,g:gamma(x+%i*y)],
     re:realpart(g),
     im:imagpart(g),
     sqrt(re^2+im^2))$
draw3d(zrange=[0,6],
       xu_grid = 50,
       yv_grid = 50,
       surface_hide =true,
       contour = surface,
       color = cyan,
       /* uncomment next line if you want an eps file */
       /*terminal = eps_color,*/
       user_preamble="set cntrparam levels incremental 0,0.5,6",
       explicit(gamma2(x,y),x,-4,4,y,-2,2));


Some comments:

1. gamma2(re,im):=abs(gamma(re+%i*im)) does not work, giving an error
message; I think the origin is float:
(%i78) float(abs(gamma(5+%i*7)));
(%o78)    cabs(.3421868495834867 - .08104666827127174 %i)
Shouldn't the result be a real number?

2. At this moment, the draw package doesn't have any option to
personalize countour intervals, therefore the use of user_preamble and
native gnuplot code. I'll add a more friendly option in future versions.

3. Some other examples:
/* sin(z) */
sin2(re,im):=abs(sin(re+%i*im));
draw3d(surface_hide =true,
       color = green,
       contour = both,
       explicit(sin2(x,y),x,-10,10,y,-10,10) );


/* z^3+1 */
z3(x,y):= abs((x+y*%i)^3+1);
draw3d(surface_hide =true,
       color = green,
       contour = both,
       enhanced3d=true,
       explicit(z3(x,y),x,-10,10,y,-10,10) );

/* 1/z^2 */
f2(x,y):=abs(1/(x+y*%i)^2)$
draw3d(surface_hide =true,
       color = green,
       contour = surface,
       zrange=[0,50],
       user_preamble="set cntrparam levels incremental 0,2,20",
       explicit(f2(x,y),x,-1,1,y,-1,1) );


Hope this helps.

-- 
Mario Rodriguez Riotorto
www.biomates.net