Transform Spherical to polar coordinates
[phi,p,z]=sph2pol(r,theta,phi)
radius
elevation angle
azimuth angle
radius in xy plane
z coordinate
sph2pol(r,theta,phi) transforms corresponding elements of data stored in spherical coordinates r,theta,phi to cylindrical coordinates (angle phi, radius p, height Z). phi is returned in radians. The arrays r,theta and phi must be the same size (or any of them can be scalar).
add sample pgm