/*  
 *  - - - - - - - - - - - - -
 *   g a l _ c 2 t p v 0 0 a 
 *  - - - - - - - - - - - - -
 *  
 *  This routine is part of the General Astrodynamics Library  
 *  
 *  Description: 
 *  
 *     This routine converts a position & velocity vector in the GCRF reference
 *     frame to the ITRF reference frame (IAU 2000A Resolutions).  
 *  
 *  Status:
 *  
 *     support routine.  
 *  
 *  Given:
 *  
 *     gcrf             d[2][3]     GCRF position & velocity vector ( m, m/s )
 *     utc1                d        UTC date part 1 ( see Note 1 )
 *     utc2                d        UTC date part 2 ( see Note 1 )
 *     dut1                d        UT1 - UTC ( seconds )
 *     lod                 d        Excess length of day ( seconds )
 *     xp                  d        x coordinate of the pole (radians, Note 2) 
 *     yp                  d        y coordinate of the pole (radians, Note 2) 
 *  
 *  Returned:
 *  
 *     itrf             d[2][3]     ITRF position & velocity vector ( m, m/s )
 *  
 *  Notes:
 *
 *  1) The Julian Date is apportioned in any convenient way between  
 *     the arguments utc1 and utc2.  For example, JD=2450123.7 could  
 *     be expressed in any of these ways, among others:  
 *  
 *              utc1         utc2  
 *  
 *         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)  
 *  
 *  2) xp and yp are the "coordinates of the pole", in seconds, which  
 *     position the Celestial Intermediate Pole in the International  
 *     Terrestrial Reference System (see IERS Conventions 2003).  In a  
 *     geocentric right-handed triad u,v,w, where the w-axis points at  
 *     the north geographic pole, the v-axis points towards the origin  
 *     of longitudes and the u axis completes the system, xp = +u and  
 *     yp = -v.  
 *
 *  Called:
 *
 *     gal_utc2tt                    Convert UTC date to TT
 *     gal_utc2ut1                   Convert UTC date to UT1
 *     gal_c2i00a                    Form the celestial-to-intermediate 
 *                                   matrix for a given date using the  
 *                                   IAU 2000A precession-nutation model
 *     gal_rxpv                      Multiply a pv-vector by an r-matrix
 *     gal_i2tpv00                   converts a position & velocity vector 
 *                                   in the CIRS reference frame to the ITRF 
 *                                   reference frame (IAU 2000 Resolutions).  
 *
 *  References:
 *
 *     SOFA Tools for Earth Attitude
 *     IAU Standards for Fundamental Astronomy Review Board
 *     2007
 *     http://www.iau-sofa.rl.ac.uk
 *
 *     Fundamentals of Astrodynamics and Applications
 *     Vallado, David A. Second Edition 2004
 *     Pages 217-219
 *
 *  This revision:
 *  
 *     2008 May 25   
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.  
 *  
 *-----------------------------------------------------------------------  
 */  
  
#ifndef _GAL_C2TPV00A_H_  
#define _GAL_C2TPV00A_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_c2tpv00a  
 ( 
   double gcrf[2][3],
   double utc1,
   double utc2,
   double dut1,
   double lod,
   double xp,
   double yp,
   double itrf[2][3]
 ) ;  
  
__END_DECLS  
  
#endif /* !_GAL_C2TPV00A_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  
 */  
