/*  
 *  - - - - - - - - -  
 *   g a l _ a 2 a f  
 *  - - - - - - - - -  
 *  
 *  This routine is part of the General Astrodynamics Library  
 *  
 *  Description: 
 *  
 *  Decompose radians into degrees, arcminutes, arcseconds, fraction.  
 *  
 *  This routine is an independent translation of a FORTRAN routine  
 *  that is part of IAU's SOFA software collection.  
 *  
 *  Status:
 *  
 *     vector/matrix support routine.  
 *  
 *  Given:
 *  
 *     ndp                 i        resolution (Note 1)  
 *     angle               d        angle in radians  
 *  
 *  Returned:
 *  
 *     *sign               c        '+' or '-'  
 *     idmsf              i[4]      degrees, arcminutes, arcseconds, fraction  
 *  
 *  Called:
 *  
 *     gal_d2tf           decompose days to hms  
 *  
 *  Notes:  
 *  
 *  1) ndp is interpreted as follows:  
 *  
 *     ndp        resolution  
 *      :      ...0000 00 00  
 *     -7         1000 00 00  
 *     -6          100 00 00  
 *     -5           10 00 00  
 *     -4            1 00 00  
 *     -3            0 10 00  
 *     -2            0 01 00  
 *     -1            0 00 10  
 *      0            0 00 01  
 *      1            0 00 00.1  
 *      2            0 00 00.01  
 *      3            0 00 00.001  
 *      :            0 00 00.000...  
 *  
 *  2) The largest positive useful value for ndp is determined by the  
 *     size of angle, the format of DOUBLE PRECISION floating-point  
 *     numbers on the target platform, and the risk of overflowing  
 *     idmsf[3].  On a typical platform, for angle up to 2pi, the  
 *     available floating-point precision might correspond to ndp=12.  
 *     However, the practical limit is typically ndp=9, set by the  
 *     capacity of a 32-bit idmsf[3].  
 *  
 *  3) The absolute value of angle may exceed 2pi.  In cases where it  
 *     does not, it is up to the caller to test for and handle the  
 *     case where angle is very nearly 2pi and rounds up to 360 degrees,  
 *     by testing for ihmsf[0]=360 and setting ihmsf[0-3] to zero.  
 *  
 *  This revision:
 *  
 *     2005 August 26 ( c version 2008 January 27 )  
 *  
 *  
 *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.  
 *  
 *-----------------------------------------------------------------------  
 */  
  
#ifndef _GAL_A2AF_H_  
#define _GAL_A2AF_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_a2af  
 (  
    int ndp,  
    double angle,  
    char *sign,  
    int idmsf[4]  
 ) ;  
  
__END_DECLS  
  
#endif /* !_GAL_A2AF_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  
 */  
