% parab.m 96/08/20
%
% Program to plot the paraboloid z=16-x^2-y^2 for z>=0.
% 
    np=25;
    t=16*(0:np)/np;
    subplot(1,2,1)
    [X,Y,Z]=cylinder(sqrt(16-t));
    surf(X,Y,16*Z,'w')
    colormap('white');
    axis([-5 5 -5 5 0 20]); 
    xlabel('x');
    ylabel('y');
    zlabel('z');
    hold on;
    arrow3([0; 0; 16],[0; 0; 20],1);
    text(2,-2,15,'S');
    text(2,2,15,'n');
    hold off;

% 

    subplot(1,2,2)
    nt=60;
    xmax=5;
    theta=2*pi*(0:60)/60;
    z=4*exp(sqrt(-1)*theta);
    plot3(real(z),imag(z),zeros(size(z)),'w-');
    ind1=26;
    ind2=27;
    p1=[real(z(ind1)); imag(z(ind1)); 0];
    p2=[real(z(ind2)); imag(z(ind2)); 0];
    hold on;
    arrow3xy(p1,p2,.9);
    xlabel('x');
    ylabel('y');
    zlabel('z');
    axis([-5 5 -5 5 0 5]);
    text(4,4,0,'C');
    hold off;
