How to plot sin(theta)*cos(phi) in spherical coordinates
14 views (last 30 days)
[theta,phi] = meshgrid(linspace(-pi,pi,41),linspace(-pi/2,pi/2,41));
R = sin(theta)*cos(phi);
[X,Y,Z] = sph2cart(theta,phi,R);
Tried using the code above but it is not giving me what I would expect (a p orbital looking shape). Any way anyone could help me figure this out?