/*  
 *  - - - - - - - - - - - -
 *   g a l _ i 2 t p v 0 0  
 *  - - - - - - - - - - - -
 *  
 *  This routine is part of the General Astrodynamics Library  
 *  
 *  Description: 
 *  
 *     This routine converts a position & velocity vector in the CIRS reference
 *     frame to the ITRF reference frame (IAU 2000 Resolutions).  
 *  
 *  Status:
 *  
 *     support routine.  
 *  
 *  Given:
 *  
 *     cirs             d[2][3]     CIRS position & velocity vector ( m, m/s )
 *     tta                 d        TT date part 1 ( see Note 1 )
 *     ttb                 d        TT date part 2 ( see Note 1 )
 *     ut1a                d        UT1 date part 1 ( see Note 1 )
 *     ut1b                d        UT1 date part 2 ( see Note 1 )
 *     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 tta and ttb.  For example, JD=2450123.7 could  
 *     be expressed in any of these ways, among others:  
 *  
 *               tta1         ttb  
 *  
 *         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_era00                     Earth rotation angle (IAU 2000 model)                  
 *     gal_ir                        Initialize an r-matrix to the identity matrix
 *     gal_rz                        Rotate an r-matrix about the z-axis
 *     gal_rxpv                      Multiply a pv-vector by an r-matrix
 *     gal_zp                        Zero a p-vector
 *     gal_pxp                       p-vector outer (=vector=cross) product
 *     gal_pmp                       P-vector subtraction
 *     gal_sp00                      The TIO locator s', positioning the 
 *                                   Terrestrial Intermediate Origin  
 *                                   on the equator of the Celestial 
 *                                   Intermediate Pole.
 *     gal_pom00                     Form the matrix of polar motion for 
 *                                   a given date, IAU 2000. 
 *
 *  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_I2TPV00_H_  
#define _GAL_I2TPV00_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_i2tpv00  
 ( 
   double cirs[2][3],
   double tta,
   double ttb,
   double ut1a,
   double ut1b,
   double lod,
   double xp,
   double yp,
   double itrf[2][3]
 ) ;  
  
__END_DECLS  
  
#endif /* !_GAL_I2TPV00_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  
 */  
