1 /*
2  *  - - - - - - - - - -
3  *   g a l _ f k 5 h z
4  *  - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *  Transform an FK5 (J2000) star position into the system of the
11  *  Hipparcos catalogue, assuming zero Hipparcos proper motion.
12  *
13  *  This routine is an independent translation of a FORTRAN routine
14  *  that is part of IAU's SOFA software collection.
15  *
16  *  Status:
17  *
18  *     support routine.
19  *
20  *  Given:
21  *
22  *     r5                  d        FK5 RA (radians), equinox J2000, at date
23  *     d5                  d        FK5 Dec (radians), equinox J2000, at date
24  *     date1,date2         d        TDB date (Notes 1,2)
25  *
26  *  Returned:
27  *
28  *     *rh                 d        Hipparcos RA (radians)
29  *     *dh                 d        Hipparcos Dec (radians)
30  *
31  *  Notes:
32  *
33  *  1) This routine converts a star position from the FK5 system to
34  *     the Hipparcos system, in such a way that the Hipparcos proper
35  *     motion is zero.  Because such a star has, in general, a non-zero
36  *     proper motion in the FK5 system, the routine requires the date
37  *     at which the position in the FK5 system was determined.
38  *
39  *  2) The TT date date1+date2 is a Julian Date, apportioned in any
40  *     convenient way between the two arguments.  For example,
41  *     JD(TT)=2450123.7 could be expressed in any of these ways,
42  *     among others:
43  *
44  *            date1         date2
45  *
46  *         2450123.7          0.0        (JD method)
47  *         2451545.0      -1421.3        (J2000 method)
48  *         2400000.5      50123.2        (MJD method)
49  *         2450123.5          0.2        (date & time method)
50  *
51  *     The JD method is the most natural and convenient to use in
52  *     cases where the loss of several decimal digits of resolution
53  *     is acceptable.  The J2000 method is best matched to the way
54  *     the argument is handled internally and will deliver the
55  *     optimum resolution.  The MJD method and the date & time methods
56  *     are both good compromises between resolution and convenience.
57  *
58  *  3) The FK5 to Hipparcos transformation is modeled as a pure
59  *     rotation and spin;  zonal errors in the FK5 catalogue are
60  *     not taken into account.
61  *
62  *  4) It was the intention that Hipparcos should be a close
63  *     approximation to an inertial frame, so that distant objects
64  *     have zero proper motion;  such objects have (in general)
65  *     non-zero proper motion in FK5, and this routine returns those
66  *     fictitious proper motions.
67  *
68  *  5) The position returned by this routine is in the FK5 J2000
69  *     reference system but at date date1+date2.
70  *
71  *  6) See also gal_fk52h, gal_h2fk5, gal_hfk5z.
72  *
73  *  Called:
74  *
75  *     gal_s2c            spherical coordinates to unit vector
76  *     gal_fk5hip         FK5 to Hipparcos rotation and spin
77  *     gal_sxp            multiply p-vector by scalar
78  *     gal_rv2m           r-vector to r-matrix
79  *     gal_trxp           product of transpose of r-matrix and p-vector
80  *     gal_pxp            vector product of two p-vectors
81  *     gal_c2s            p-vector to spherical
82  *     gal_anp            normalize angle into range 0 to 2pi
83  *
84  *  References:
85  *
86  *     F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
87  *
88  *  This revision:
89  *
90  *     2007 April 18 ( c version 2008 February 4 )
91  *
92  *
93  *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.
94  *
95  *-----------------------------------------------------------------------
96  */
97 
98 #ifndef _GAL_FK5HZ_H_
99 #define _GAL_FK5HZ_H_ 1
100 
101 #undef __BEGIN_DECLS
102 #undef __END_DECLS
103 #ifdef __cplusplus
104 #define __BEGIN_DECLS extern "C" {
105 #define __END_DECLS }
106 #else
107 #define __BEGIN_DECLS /* empty */
108 #define __END_DECLS   /* empty */
109 #endif
110 
111 __BEGIN_DECLS
112 
113 void
114 gal_fk5hz
115  (
116     double r5,
117     double d5,
118     double date1,
119     double date2,
120     double *rh,
121     double *dh
122  ) ;
123 
124 __END_DECLS
125 
126 #endif /* !_GAL_FK5HZ_H_ */
127 
128 /*
129  *  gal - General Astrodynamics Library
130  *  Copyright (C) 2008 Paul C. L. Willmott
131  *
132  *  This program is free software; you can redistribute it and/or modify
133  *  it under the terms of the GNU General Public License as published by
134  *  the Free Software Foundation; either version 2 of the License, or
135  *  (at your option) any later version.
136  *
137  *  This program is distributed in the hope that it will be useful,
138  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
139  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
140  *  GNU General Public License for more details.
141  *
142  *  You should have received a copy of the GNU General Public License along
143  *  with this program; if not, write to the Free Software Foundation, Inc.,
144  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
145  *
146  *  Contact:
147  *
148  *  Paul Willmott
149  *  vp9mu@amsat.org
150  */
151