$LastChangedDate: 27-Juil-2011 $

# CL_co_car2sph

Cartesian coordinates to spherical coordinates

## Calling Sequence

       [pos_sph [,vel_sph,jacob]] = CL_co_car2sph(pos_car [,vel_car])

## Description

- 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.

## Parameters

pos_car :

  [X;Y;Z] Position vector in cartesian coordinates [m] (3xN)

vel_car :

  (optional, needed for vel_sph and jacob computation) [Vx;Vy;Vz] Velocity vector in cartesian coordinates [m/s] (3xN)

pos_sph :

  [lon;lat;r] Position vector in spherical coordinates [rad,m](3xN)

vel_sph :

  (optional) [d(lon)/dt;d(lat)/dt;d(r)/dt] Derivatives of spherical coordinates [rad/s,m/s] (3xN)

jacob :

  (optional) Transformation jacobian (6x6xN)

## Authors

- CNES - DCT/SB

## Bibliography

- 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)

## See also

- CL_co_sph2car

- CL_oe_car2cir

- CL_oe_car2cirEqua

- CL_co_car2ell

- CL_oe_car2kep

## Examples

    // Example 1
    pos_car = [3842403.1 ; -5057704.6 ; 577780.5];
    [pos_sph] = CL_co_car2sph(pos_car);

    // Example 2
    vel_car = [1000;1000;100];
    [pos_sph,vel_sph,jacob] = CL_co_car2sph(pos_car,vel_car);