%The wavefunctions come from Table 3.1 and 3.3, p. 19 and 23 of the book "Valence Theory", by Murrell et al %COde is based on the Journal of Chemical Education article "Examining the Shapes of Atomic Orbitals Using Mathcad", %Vol 72 No. 12 Dec 1995 p.1082-1083 %Define theta (ranges from 0 to pi) and phi (ranges from 0 to 2pi) i=0:0.5:40; theta=pi*i/40; j=0:0.5:40; phi=2*pi*j/40; %Use meshgrid to set up plot [X,Y]=meshgrid(theta,phi); %Define wavefunctions s=1/(2*sqrt(pi)); px=sqrt(3)/(2*sqrt(pi))*sin(X).*cos(Y); dz2= dxz= %Plot 2s orb=s; x=orb.*sin(X).*cos(Y); y=orb.*sin(X).*sin(Y); z=orb.*cos(X); %Plot 2px %Plot 3dz2 %Plot 3dxz