Cartesian coordinates to spherical coordinates
[pos_sph, jacob] = CL_co_car2sph(pos_car) [pos_sph, pos_sph_dot, jacob] = CL_co_car2sph(pos_car [,vel_car]) [pv_sph, jacob] = CL_co_car2sph(pv_car)
Converts cartesian coordinates into spherical coordinates.
Optionally converts time derivatives of cartesian coordinates into time derivatives of spherical coordinates.
Notes:
- Longitudes of points along the Z-axis are arbitrarily set to 0.
- The jacobian is computed if the corresponding output argument exists.
- Elements of the jacobian that cannot be computed (on the Z-axis) are set to %nan.
- Beware that the 3rd spherical coordinate is a radius and not an altitude.
- Input arguments cannot be named.
[x;y;z] Position vector in cartesian coordinates [m] (3xN)
(optional) [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] Time derivatives of spherical coordinates [rad/s,m/s] (3xN)
[pos_car; vel_car] (6xN)
[pos_sph; pos_sph_dot] (6xN)
(optional) Transformation jacobian (3x3xN) or (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)