/*  
 *  - - - - - - - - -  
 *   g a l _ p 0 6 e  
 *  - - - - - - - - -  
 *  
 *  This routine is part of the General Astrodynamics Library  
 *  
 *  Description: 
 *  
 *  Precession angles, IAU 2006, equinox based.  
 *  
 *  This routine is an independent translation of a FORTRAN routine  
 *  that is part of IAU's SOFA software collection.  
 *  
 *  Status:
 *  
 *     canonical models.  
 *  
 *  Given:
 *  
 *     date1,date2         d        TT as a 2-part Julian Date (Note 1)  
 *  
 *  Returned (see Note 2):  
 *     eps0                d        epsilon_0  
 *     psia                d        psi_A  
 *     oma                 d        omega_A  
 *     bpa                 d        P_A  
 *     bqa                 d        Q_A  
 *     pia                 d        pi_A  
 *     bpia                d        Pi_A  
 *     epsa                d        obliquity epsilon_A  
 *     chia                d        chi_A  
 *     za                  d        z_A  
 *     zetaa               d        zeta_A  
 *     thetaa              d        theta_A  
 *     pa                  d        p_A  
 *     gam                 d        F-W angle gamma_J2000  
 *     phi                 d        F-W angle phi_J2000  
 *     psi                 d        F-W angle psi_J2000  
 *  
 *  Notes:  
 *  
 *  1) The TT date date1+date2 is a Julian Date, apportioned in any  
 *     convenient way between the two arguments.  For example,  
 *     JD(TT)=2450123.7 could be expressed in any of these ways,  
 *     among others:  
 *  
 *            date1         date2  
 *  
 *         2450123.7          0.0        (JD method)  
 *         2451545.0      -1421.3        (J2000 method)  
 *         2400000.5      50123.2        (MJD method)  
 *         2450123.5          0.2        (date & time method)  
 *  
 *     The JD method is the most natural and convenient to use in  
 *     cases where the loss of several decimal digits of resolution  
 *     is acceptable.  The J2000 method is best matched to the way  
 *     the argument is handled internally and will deliver the  
 *     optimum resolution.  The MJD method and the date & time methods  
 *     are both good compromises between resolution and convenience.  
 *  
 *  2) This routine returns the set of equinox based angles for the  
 *     Capitaine et al. "P03" precession theory, adopted by the IAU in  
 *     2006.  The angles are set out in Table 1 of Hilton et al. (2006):  
 *  
 *      eps0   epsilon_0   obliquity at J2000  
 *      psia   psi_A       luni-solar precession  
 *      oma    omega_A     inclination of equator wrt J2000 ecliptic  
 *      bpa    P_A         ecliptic pole x, J2000 ecliptic triad  
 *      bqa    Q_A         ecliptic pole -y, J2000 ecliptic triad  
 *      pia    pi_A        angle between moving and J2000 ecliptics  
 *      bpia   Pi_A        longitude of ascending node of the ecliptic  
 *      epsa   epsilon_A   obliquity of the ecliptic  
 *      chia   chi_A       planetary precession  
 *      za     z_A         equatorial precession: -3rd 323 Euler angle  
 *      zetaa  zeta_A      equatorial precession: -1st 323 Euler angle  
 *      theta theta_A     equatorial precession: 2nd 323 Euler angle  
 *      pa     p_A         general precession  
 *      gam    gamma_J2000 J2000 RA difference of ecliptic poles  
 *      phi    phi_J2000   J2000 codeclination of ecliptic pole  
 *      psi    psi_J2000   longitude difference of equator poles, J2000  
 *  
 *     The returned values are all radians.  
 *  
 *  3) Hilton et al. (2006) Table 1 also contains angles that depend on  
 *     models distinct from the P03 precession theory itself, namely the  
 *     IAU 2000A frame bias and nutation.  The quoted polynomials are  
 *     used in other SOFA routines:  
 *  
 *     . gal_XY06 contains the polynomial parts of the X and Y series.  
 *  
 *     . gal_S06 contains the polynomial part of the s+XY/2 series.  
 *  
 *     . gal_PFW06 implements the series for the Fukushima-Williams  
 *       angles that are with respect to the GCRS pole (i.e. the variants  
 *       that include frame bias).  
 *  
 *  4) The IAU resolution stipulated that the choice of parameterization  
 *     was left to the user, and so an IAU compliant precession  
 *     implementation can be constructed using various combinations of  
 *     the angles returned by the present routine.  
 *  
 *  5) The parameterization used by SOFA is the Fukushima-Williams angles  
 *     referred directly to the GCRS pole.  These are the final four  
 *     arguments returned by the present routine, but are more  
 *     efficiently calculated by calling the routine gal_pfw06.  SOFA  
 *     also supports the direct computation of the CIP GCRS X,Y by  
 *     series, available by calling gal_xy06.  
 *  
 *  6) The agreement between the different parameterizations is at the  
 *     1 microarcsecond level in the present era.  
 *  
 *  7) When constructing a precession formulation that refers to the GCRS  
 *     pole rather than the dynamical pole, it may (depending on the  
 *     choice of angles) be necessary to introduce the frame bias  
 *     explicitly.  
 *  
 *  References:  
 *  
 *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351  
 *  
 *  Called:
 *  
 *     gal_obl06          mean obliquity, IAU 2006  
 *  
 *  This revision:
 *  
 *     2007 June 8 ( c version 2008 January 19 )  
 *  
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.  
 *  
 *-----------------------------------------------------------------------  
 */  
  
#ifndef _GAL_P06E_H_  
#define _GAL_P06E_H_ 1  

#undef __BEGIN_DECLS  
#undef __END_DECLS  
#ifdef __cplusplus  
#define __BEGIN_DECLS extern "C" {  
#define __END_DECLS }  
#else  
#define __BEGIN_DECLS /* empty */  
#define __END_DECLS   /* empty */  
#endif
  
__BEGIN_DECLS  
  
void gal_p06e  
 (  
    double date1,  
    double date2,  
    double *eps0,  
    double *psia,  
    double *oma,  
    double *bpa,  
    double *bqa,  
    double *pia,  
    double *bpia,  
    double *epsa,  
    double *chia,  
    double *za,  
    double *zetaa,  
    double *thetaa,  
    double *pa,  
    double *gam,  
    double *phi,  
    double *psi  
 ) ;  
  
__END_DECLS  
  
#endif /* !_GAL_P06E_H_ */  

/*  
 *  gal - General Astrodynamics Library  
 *  Copyright (C) 2008 Paul C. L. Willmott  
 *  
 *  This program is free software; you can redistribute it and/or modify  
 *  it under the terms of the GNU General Public License as published by  
 *  the Free Software Foundation; either version 2 of the License, or  
 *  (at your option) any later version.  
 *  
 *  This program is distributed in the hope that it will be useful,  
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of  
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 *  GNU General Public License for more details.  
 *  
 *  You should have received a copy of the GNU General Public License along  
 *  with this program; if not, write to the Free Software Foundation, Inc.,  
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  
 *  
 *  Contact:  
 *  
 *  Paul Willmott  
 *  vp9mu@amsat.org  
 */  
