function my_cplxlog(m)
%   MY_CPLXLOG renders the Riemann surface for the logarithm.

% RCS:  Oct. 10, 2000

% Use polar coordinates, (r,theta).
% Cover the unit disc a couple of times.

if nargin < 1, m = 20; end
r = (0:m)'/m;
theta = pi*(-m:3*m)/m;
R=r*ones(size(theta));
THETA=(theta'*ones(size(r))')';

z = r * exp(i*theta);

s = log(R)+i*THETA;

%  colormap(hsv(64)) % RCS 
colormap(jet) % RCS 

x=real(z);y=imag(z); blue=.2;
flat = ones(size(z));
mesh(x,y,0*flat,blue*flat);
hold on
title('arg(z)')
mesh(real(z),imag(z),THETA,R); pause
hold off
clf;colormap(jet) % RCS 

mesh(real(z),imag(z),log(R),THETA); 
title('ln(|z|)');pause