function symmetricdrop
n = 1000;
kappa = 1.0;
lambda = 2;
height = 1.6;

r = zeros(1,n);
u = zeros(1,n);
phi = 0:pi/(n-1):pi;
ds = mean(diff(phi))

r(1) = 0;
u(1) = height;
r(2) = -2*ds/(kappa*u(1)-lambda);
u(2) = height;
%[1,phi(1),r(1),u(1)]
%[2,phi(2),r(2),u(2)]

i=2;
while(u(i) > 0 & i < n-1)
    i = i+1;
    r(i) = r(i-1)-r(i-1)*cos(phi(i-1))*ds/(r(i-1)*(kappa*u(i-1)-lambda)+sin(phi(i-1)));
    u(i) = u(i-1)+r(i-1)*sin(phi(i-1))*ds/(r(i-1)*(kappa*u(i-1)-lambda)+sin(phi(i-1)));
end
N=i
r1 = r(1:N);
u1 = u(1:N);
figure(1); plot(r1,u1,'r'); axis equal;

[s,t] = meshgrid(0:2*pi/100:2*pi,0:pi/(N-1):pi);
for i=1:N
    for j=1:101
        x(i,j) = cos(s(i,j)).*r1(i);
        y(i,j) = sin(s(i,j)).*r1(i);
        z(i,j) = u1(i);
    end
end

figure(2); surf(x,y,z,'edgecolor','none'); axis equal; 
