MATLAB: How to plot projection of function in spherical cordinates (surface) in xy,yz or zx plane in matlab

MATLABprojectionspherical 3d plot

fx= 1/sin(theta)^2 cos(phi)^4 + cos(theta)^2cos(phi)^2
i want to plot spherical 3d surface plot and to show its projection on x,y or z plane

Best Answer

[theta,phi] = ndgrid(0:.1:2*pi, 0:.1:2*pi);
fx = 1./sin(theta).^2.*cos(phi).^4 + cos(theta).^2.*cos(phi).^2;
[X,Y,Z] = sph2cart(theta,phi,15);
surf(X,Y,Z);
Related Question