Cartesian coordinates to spherical coordinates
[pos_sph [,vel_sph,jacob]] = CL_co_car2sph(pos_car [,vel_car])
Converts cartesian coordinates into spherical coordinates.
The input arguments can consist in position only, or position and velocity, in which case the derivatives of the spherical coordinates with respect to time are computed as well.
Notes:
- The transformation jacobian is computed if the corresponding output argument exists.
- Be careful that the 3rd coordinate is the distance to the planet center and not an altitude.
[X;Y;Z] Position vector in cartesian coordinates [m] (3xN)
(optional, needed for vel_sph and jacob computation) [Vx;Vy;Vz] Velocity vector in cartesian coordinates [m/s] (3xN)
[lon;lat;r] Position vector in spherical coordinates [rad,m](3xN)
(optional) [d(lon)/dt;d(lat)/dt;d(r)/dt] Derivatives of spherical coordinates [rad/s,m/s] (3xN)
(optional) Transformation jacobian (6x6xN)
CNES - DCT/SB
1) Mecanique Spatiale, Cnes - Cepadues Editions, Tome I, section 3.2.3 (Les reperes de l'espace et du temps, Relations entre les coordonnees)
2) CNES - MSLIB FORTRAN 90, Volume T (mt_car_geoc)