Cart2Sph:

--------------------------------------------------------------------------
   Converts cartesian coordinates to spherical.

   Since version 1.
--------------------------------------------------------------------------
   Form:
   [r, theta, phi] = Cart2Sph( x, y, z )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x                     (:,:)  Either x or [x;y;z]
   y                     (:)    y
   z                     (:)    z

   -------
   Outputs
   -------
   r                     (:,:)  r or [r;theta;phi] (r is vector magnitude)
   theta                 (:)    theta (angle in xy-plane)
   phi                   (:)    phi (angle measured from z axis to xy plane)

--------------------------------------------------------------------------