1 /*
2  *  - - - - - - - - - -
3  *   g a l _ p n 0 6 a
4  *  - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *  Precession-nutation, IAU 2006/2000A models:  a multi-purpose routine,
11  *  supporting classical (equinox-based) use directly and CIO-based use
12  *  indirectly.
13  *
14  *  This routine is an independent translation of a FORTRAN routine
15  *  that is part of IAU's SOFA software collection.
16  *
17  *  Status:
18  *
19  *     support routine.
20  *
21  *  Given:
22  *
23  *     date1,date2         d        TT as a 2-part Julian Date (Note 1)
24  *
25  *  Returned:
26  *
27  *     *dpsi,*deps         d        nutation (Note 2)
28  *     *epsa               d        mean obliquity (Note 3)
29  *     rb               d[3][3]     frame bias matrix (Note 4)
30  *     rp               d[3][3]     precession matrix (Note 5)
31  *     rbp              d[3][3]     bias-precession matrix (Note 6)
32  *     rn               d[3][3]     nutation matrix (Note 7)
33  *     rbpn             d[3][3]     GCRS-to-true matrix (Notes 8,9)
34  *
35  *  Notes:
36  *
37  *  1) The TT date date1+date2 is a Julian Date, apportioned in any
38  *     convenient way between the two arguments.  For example,
39  *     JD(TT)=2450123.7 could be expressed in any of these ways,
40  *     among others:
41  *
42  *            date1         date2
43  *
44  *         2450123.7          0.0        (JD method)
45  *         2451545.0      -1421.3        (J2000 method)
46  *         2400000.5      50123.2        (MJD method)
47  *         2450123.5          0.2        (date & time method)
48  *
49  *     The JD method is the most natural and convenient to use in
50  *     cases where the loss of several decimal digits of resolution
51  *     is acceptable.  The J2000 method is best matched to the way
52  *     the argument is handled internally and will deliver the
53  *     optimum resolution.  The MJD method and the date & time methods
54  *     are both good compromises between resolution and convenience.
55  *
56  *  2) The nutation components (luni-solar + planetary, IAU 2000A) in
57  *     longitude and obliquity are in radians and with respect to the
58  *     equinox and ecliptic of date.  Free core nutation is omitted;  for
59  *     the utmost accuracy, use the gal_PN06 routine, where the nutation
60  *     components are caller-specified.
61  *
62  *  3) The mean obliquity is consistent with the IAU 2006 precession.
63  *
64  *  4) The matrix rb transforms vectors from GCRS to mean J2000 by
65  *     applying frame bias.
66  *
67  *  5) The matrix rp transforms vectors from mean J2000 to mean of date
68  *     by applying precession.
69  *
70  *  6) The matrix rbp transforms vectors from GCRS to mean of date by
71  *     applying frame bias then precession.  It is the product RP x RB.
72  *
73  *  7) The matrix rn transforms vectors from mean of date to true of date
74  *     by applying the nutation (luni-solar + planetary).
75  *
76  *  8) The matrix rbpn transforms vectors from GCRS to true of date
77  *     (CIP/equinox).  It is the product rn x rbp, applying frame bias,
78  *     precession and nutation in that order.
79  *
80  *  9) The X,Y,Z coordinates of the IAU 2006/2000A Celestial Intermediate
81  *     Pole are elements [0-2][2] of the matrix rbpn.
82  *
83  *  Called:
84  *
85  *     gal_nut06a         nutation, IAU 2006/2000A
86  *     gal_pn06           bias/precession/nutation results, IAU 2006
87  *
88  *  References:
89  *
90  *     Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
91  *
92  *  This revision:
93  *
94  *     2007 May 11 ( c version 2008 February 4 )
95  *
96  *
97  *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.
98  *
99  *-----------------------------------------------------------------------
100  */
101 
102 #include "gal_pn06a.h"
103 #include "gal_nut06a.h"
104 #include "gal_pn06.h"
105 
106 void
gal_pn06a(double date1,double date2,double * dpsi,double * deps,double * epsa,double rb[3][3],double rp[3][3],double rbp[3][3],double rn[3][3],double rbpn[3][3])107 gal_pn06a
108  (
109     double date1,
110     double date2,
111     double *dpsi,
112     double *deps,
113     double *epsa,
114     double rb[3][3],
115     double rp[3][3],
116     double rbp[3][3],
117     double rn[3][3],
118     double rbpn[3][3]
119  )
120 {
121 
122 /*
123  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
124  */
125 
126 /*
127  * Nutation.
128  */
129 
130     gal_nut06a ( date1, date2, dpsi, deps ) ;
131 
132 /*
133  * Remaining results.
134  */
135 
136     gal_pn06 ( date1, date2, *dpsi, *deps, epsa, rb, rp, rbp, rn, rbpn ) ;
137 
138 /*
139  * Finished.
140  */
141 
142 }
143 
144 /*
145  *  gal - General Astrodynamics Library
146  *  Copyright (C) 2008 Paul C. L. Willmott
147  *
148  *  This program is free software; you can redistribute it and/or modify
149  *  it under the terms of the GNU General Public License as published by
150  *  the Free Software Foundation; either version 2 of the License, or
151  *  (at your option) any later version.
152  *
153  *  This program is distributed in the hope that it will be useful,
154  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
155  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
156  *  GNU General Public License for more details.
157  *
158  *  You should have received a copy of the GNU General Public License along
159  *  with this program; if not, write to the Free Software Foundation, Inc.,
160  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
161  *
162  *  Contact:
163  *
164  *  Paul Willmott
165  *  vp9mu@amsat.org
166  */
167