$LastChangedDate: 27-Juil-2011 $

# CL_co_car2ell

Cartesian coordinates to elliptical coordinates

## Calling Sequence

       [pos_ell [,jacob]] = CL_co_car2ell(pos_car [,er,obla])

## Description

- Converts cartesian coordinates into elliptical ("geodetic") coordinates.

  Elliptical coordinates are longitude, latitude and altitude with respect to some reference ellipsoid.

  The reference ellipsoid is an ellipsoid of revolution around the Z axis. It is then characterized by 2 parameters:

  - semi-major axis of the ellipse obtained as the intersection of the ellipsoid with any plane containing the Z axis,

  - oblateness (or flattening) of this ellipse.

- Notes:

  - The transformation jacobian is computed if the corresponding output argument exists.

  - Be careful that the 3rd elliptical coordinate is an altitude and not the distance to the planet center.

## Parameters

pos_car :

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

er :

  (optional) Equatorial radius of reference ellipsoid [m] (default is %CL_eqRad)

obla :

  (optional) Oblateness of reference ellipsoid (default is %CL_obla)

pos_ell :

  Position vector in elliptical ("geodetic") coordinates [longitude;latitude;alt] [rad,m] (3xN)

jacob :

  (optional) Transformation jacobian (3x3xN)

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

## See also

- CL_co_ell2car

- CL_oe_car2cir

- CL_oe_car2cirEqua

- CL_co_car2sph

- CL_oe_car2kep

## Authors

- CNES - DCT/SB

## Examples

    // Example 1
    pos_car = [4637885.347 ; 121344.608 ; 4362452.869];
    [pos_ell] = CL_co_car2ell(pos_car);

    // Example 2 : consistency test
    pos_car = [4637885.347,121344.608,4362452.869]';
    [pos_ell,jacob1] = CL_co_car2ell(pos_car);
    [pos_car2,jacob2] = CL_co_ell2car(pos_ell);
    M = jacob1*jacob2;  // identity matrix