% Plots xy plane and uv plane for given function
% See complexgrid2.m to only plot uv plane
% See complexplot.m to plot single lines

clear
% Enter function
%fn = @(x) x;
%fn = @(x) x.^2;
%fn = @(x) exp(x);
%fn = @(x) 1./(x.*(1/2-x).*(x-i).*(x-i+1));
%fn = @(x) sqrt(x+1);
fn = @(x) 1./x;
for p=-2.0001:0.25:2;
t = -2: 0.05: 2;
h = p + t*i;
%h = 1 + t*i;
subplot(1,2,1)
plot(h,'k','LineWidth',1)
axis( [-2,2, -2,2] )
axis square; %grid on
hold on
subplot(1,2,2)
plot(fn(h),'k','LineWidth',1)
axis( [-4,4, -4,4] )
axis square; %grid on
hold on
end
for p=-2.0001:0.25:2;
t = -2: 0.05: 2;
h = p*i + t;
%h = 1*i + t;
subplot(1,2,1)
plot(h,'k--','LineWidth',1)
axis( [-2,2, -2,2] )
axis square; 
set(gca,'FontSize',14)
xlabel('\itx','FontSize',14)
ylabel('\ity','FontSize',14,'Rotation',0)
hold on
subplot(1,2,2)
plot(fn(h),'k--','LineWidth',1)
axis( [-4,4, -4,4] )
axis square; 
set(gca,'FontSize',16)
xlabel('\itu','FontSize',16)
ylabel('\itv','FontSize',16,'Rotation',0)
hold on
end
hold off
set(gcf,'Color',[1,1,1])