% Plots curves in xy plane and their images in the uv plane 
% for a given function

clear
% Enter function
fn = @(x) 1./x;

% xy-plane
%plot vertical lines and images
for p=-2.0001:0.25:2;
    t = -2: 0.05: 2;
    h = p + t*i;
    subplot(1,2,1)
    plot(h,'k','LineWidth',1)
    axis( [-2,2, -2,2] )
    axis square; 
    hold on
    
    subplot(1,2,2)
    plot(fn(h),'k','LineWidth',1)
    axis( [-4,4, -4,4] )
    axis square; 
    hold on
end

% Plot horizontal lines
for p=-2.0001:0.25:2;
    t = -2: 0.05: 2;
    h = p*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])