/*  
 *  - - - - - - - - - - -  
 *   g a l _ c 2 t e q x  
 *  - - - - - - - - - - -  
 *  
 *  This routine is part of the General Astrodynamics Library  
 *  
 *  Description: 
 *  
 *  Assemble the celestial to terrestrial matrix from equinox-based  
 *  components (the celestial-to-true matrix, the Greenwich Apparent  
 *  Sidereal Time and the polar motion matrix).  
 *  
 *  This routine is an independent translation of a FORTRAN routine  
 *  that is part of IAU's SOFA software collection.  
 *  
 *  Status:
 *  
 *     support routine.  
 *  
 *  Given:
 *  
 *     rbpn             d[3][3]     celestial-to-true matrix  
 *     gst                 d        Greenwich (apparent) Sidereal Time  
 *     rpom             d[3][3]     polar-motion matrix  
 *  
 *  Returned:
 *  
 *     rc2t             d[3][3]     celestial-to-terrestrial matrix (Note 2)  
 *  
 *  Notes:  
 *  
 *  1) This routine constructs the rotation matrix that transforms  
 *     vectors in the celestial system into vectors in the terrestrial  
 *     system.  It does so starting from precomputed components, namely  
 *     the matrix which rotates from celestial coordinates to the  
 *     true equator and equinox of date, the Greenwich Apparent Sidereal  
 *     Time and the polar motion matrix.  One use of the present routine  
 *     is when generating a series of celestial-to-terrestrial matrices  
 *     where only the Sidereal Time changes, avoiding the considerable  
 *     overhead of recomputing the precession-nutation more often than  
 *     necessary to achieve given accuracy objectives.  
 *  
 *  2) The relationship between the arguments is as follows:  
 *  
 *        [TRS]  =  rpom * R_3(gst) * rbpn * [CRS]  
 *  
 *               =  rc2t * [CRS]  
 *  
 *     where [CRS] is a vector in the Geocentric Celestial Reference  
 *     System and [TRS] is a vector in the International Terrestrial  
 *     Reference System (see IERS Conventions 2003).  
 *  
 *  Called:
 *  
 *     gal_cr             copy r-matrix  
 *     gal_rz             rotate around Z-axis  
 *     gal_rxr            product of two r-matrices  
 *  
 *  References:  
 *  
 *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),  
 *     IERS Technical Note No. 32, BKG (2004)  
 *  
 *  This revision:
 *  
 *     2006 November 13 ( c version 2008 January 18 )  
 *  
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.  
 *  
 *-----------------------------------------------------------------------  
 */  
  
#ifndef _GAL_C2TEQX_H_  
#define _GAL_C2TEQX_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_c2teqx  
 (  
    double rbpn[3][3],  
    double gst,  
    double rpom[3][3],  
    double rc2t[3][3]  
 ) ;  
  
__END_DECLS  
  
#endif /* !_GAL_C2TEQX_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  
 */  
