$LastChangedDate: 27-Juil-2011 $

# CL_mod_moonSunG50

Moon and Sun positions in Gamma50 (Veis) reference frame

## Calling Sequence

       [u_body,r_body] = CL_mod_moonSunG50(cjd, body)
       [u_moon,r_moon,u_sun,r_sun] = CL_mod_moonSunG50(cjd)

## Description

- Computes the Moon and/or Sun positions relative to Gamma50 (Veis) reference frame using a simplified version of BROWN theories for the moon and NEWCOMB for the Sun.

  The Moon or Sun position is defined by a unit vector u_body and a distance r_body from the Earth centre to the centre of the body.

  Either the Moon position, the Sun position or both can be computed.

## Parameters

cjd :

  Modified (1950.0) julian day (TUC) (1xN)

body :

  (string, optional) Type can be 'm' or 'moon' for the moon,'s' or 'sun' for the Sun (or 'b' or 'both' for both).

u_body :

  Unit vector from Earth to body [rx;ry;rz] (3xN)

r_body :

  Distance from Earth to body [m] (1xN)

## Bibliography

- 1 CNES - MSLIB FORTRAN 90, Volume S (ms_pos_soleil_lune)

## Authors

- CNES - DCT/SB

## Examples

    // Sun position in J2000 frame on the 25th of october 2008 and 2009
    cjd = CL_dat_cal2cjd([2008 2009],[10 10],[25 25]);
    [r_sun,rs] = CL_mod_moonSunG50(cjd,'s');
    pos_sun_G50 = CL_dMult(r_sun,rs);
    M = CL_fr_G502J2000Mat(cjd);
    pos_sun_J2000 = M*pos_sun_G50;

    // Sun right ascension and declination at the same dates :
    pos_sph = CL_co_car2sph(pos_sun_J2000);
    alpha_sun = pos_sph(1,:);
    delta_sun = pos_sph(2,:);