% kontursp - contour curves for sp_z-orbital
close all; clear all; 

accuracy=200;
c=1/sqrt(2); sq=sqrt(1-c^2); % equal parts of 2s and 2p_z orbitals
zz=linspace(-8,10,200);
langszaksen=(c*(abs(zz)-2)+sq*zz).*exp(-abs(zz)/2);
plot(zz,langszaksen);
line(zz,zz-zz);    %abscissa axis (z-axis)
t1=text(0.6,-1.7,'z/a'); set(t1,'FontSize',24); % instead of xlabel('z/a');
t2=text(-6,0.6,' value of \psi along z-axis'); set(t2,'FontSize',16);

%%%%%%%%%%%print -dpng fig42159-10-20.png % for linux

figure
hold on
[x,z]=meshgrid(linspace(-8,8,accuracy),linspace(-9,12,accuracy));
r=sqrt(x.^2+z.^2);
theta=acos(z./r);
psi=exp(-r./2).*(c*(r-2)+sq*z);
contour(x,z,psi,[-1.4 : 0.1 : 0.6]);
% instead of xlabel('x/a'); ylabel('z/a'); we use:
t3=text(-0.3,-10.8,'x/a'); set(t3,'FontSize',20);
t4=text(-14,1,'z/a'); set(t4,'FontSize',18); set(t4,'rotation',90);
t5=text(5.3,-6,'\leftarrow\psi=0'); set(t5,'FontSize',16);
t6=text(-1,-7,'\Psi<0'); set(t6,'FontSize',16);
line(zz,zz-zz);
axis equal;
hold off
%%%%%%%%%%%%%%print -dpng fig42159-10-21.png % for linux



