$LastChangedDate: 27-Juil-2011 $

# CL_co_sph2car

Spherical coordinates to cartesian coordinates

## Calling Sequence

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

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

## Parameters

pos_sph :

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

vel_sph :

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

pos_car:

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

vel_car:

  (optional) [Vx,Vy,Vz] Velocity vector in cartesian coordinates [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_geoc_car)

## See also

- CL_co_car2sph

- CL_co_car2ell

- CL_co_ell2car

## Examples

    // Example 1
    pos_sph = [0,0,%CL_eqRad;%pi/2,%pi/2,%CL_eqRad]';
    pos_car = CL_co_sph2car(pos_sph);

    // Example 2 :
    pos_sph = [0.090715;5.362077;6377951.7];
    vel_sph = [1.8332e-5;2.2060e-4;-181.488];
    [pos_car,vel_car,jacob1] = CL_co_sph2car(pos_sph,vel_sph);