— Function File: [theta, phi, r] = cart2sph (x, y, z)
Transform cartesian to spherical coordinates.
x, y and z must be of same shape.
theta describes the angle relative to the x - axis.
phi is the angle relative to the xy - plane.
r is the distance to the origin (0, 0, 0).