1 /* zzeprcss.f -- translated by f2c (version 19980913).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include "f2c.h"
7 
8 /* Table of constant values */
9 
10 static integer c__3 = 3;
11 static integer c__2 = 2;
12 
13 /* $Procedure   ZZEPRCSS   ( Earth precession, 1976 IAU model ) */
zzeprcss_(doublereal * et,doublereal * precm)14 /* Subroutine */ int zzeprcss_(doublereal *et, doublereal *precm)
15 {
16     /* System generated locals */
17     doublereal d__1, d__2;
18 
19     /* Local variables */
20     doublereal zeta;
21     extern /* Subroutine */ int eul2m_(doublereal *, doublereal *, doublereal
22 	    *, integer *, integer *, integer *, doublereal *);
23     doublereal t, scale, z__, theta;
24     extern doublereal jyear_(void), rpd_(void);
25 
26 /* $ Abstract */
27 
28 /*     Return the 1976 IAU Earth precession matrix for a specified time. */
29 
30 /* $ Disclaimer */
31 
32 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
33 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
34 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
35 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
36 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
37 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
38 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
39 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
40 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
41 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
42 
43 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
44 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
45 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
46 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
47 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
48 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
49 
50 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
51 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
52 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
53 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
54 
55 /* $ Required_Reading */
56 
57 /*     ROTATION */
58 
59 /* $ Keywords */
60 
61 /*     FRAMES */
62 /*     GEOMETRY */
63 /*     MATRIX */
64 /*     TRANSFORMATION */
65 
66 /* $ Declarations */
67 /* $ Brief_I/O */
68 
69 /*     Variable  I/O  Description */
70 /*     --------  ---  -------------------------------------------------- */
71 /*     ET         I   Ephemeris time, in seconds past J2000. */
72 /*     PRECM      O   Precession matrix at ET. */
73 
74 /* $ Detailed_Input */
75 
76 /*     ET             is the epoch at which the precession matrix is */
77 /*                    to be computed.  ET is barycentric dynamical time, */
78 /*                    expressed as seconds past J2000. */
79 
80 /* $ Detailed_Output */
81 
82 /*     PRECM          is a 3x3 matrix representing the precession of */
83 /*                    the Earth from J2000 to the epoch ET.  The */
84 /*                    rows of PRECM are the basis vectors for the Earth */
85 /*                    mean equator and equinox frame of date, evaluated */
86 /*                    at ET. */
87 
88 /* $ Parameters */
89 
90 /*     None. */
91 
92 /* $ Exceptions */
93 
94 /*     Error free. */
95 
96 /* $ Files */
97 
98 /*     None. */
99 
100 /* $ Particulars */
101 
102 /*     According to reference [2], the precession model used in this */
103 /*     routine is that used in the JPL navigation program "Regres." */
104 
105 /*     The precession matrix is defined using the Euler angles */
106 
107 /*        zeta ,   z ,  and theta */
108 /*            A     A            A */
109 
110 
111 /*     Equation (5-147) of [2] gives the matrix determined by these */
112 /*     angles as */
113 
114 /*        A  =  [ -z   ]   [ theta  ]   [ -zeta  ] */
115 /*                  A   3         A  2         A  3 */
116 
117 
118 /*     Formulas for the Euler angles are from [2], equation */
119 /*     (5-143): */
120 /*                                              2                3 */
121 /*         zeta   =  2306".2181*T  +  0".30188*T   +  0".017998*T */
122 /*             A */
123 
124 
125 /*                                              2                3 */
126 /*         z      =  2306".2181*T  +  1".09468*T   +  0".018203*T */
127 /*          A */
128 
129 
130 /*                                              2                3 */
131 /*         theta  =  2004".3109*T  -  0".42665*T   -  0".041833*T */
132 /*              A */
133 
134 /* $ Examples */
135 
136 /*     1) Convert a vector V from J2000 to Earth Mean equator and equinox */
137 /*        of date coordinates at epoch ET.  Call the resulting vector */
138 /*        VMOD. */
139 
140 /*           CALL ZZEPRCSS ( ET,    PRECM       ) */
141 /*           CALL MXV      ( PRECM, V,     VMOD ) */
142 
143 /* $ Restrictions */
144 
145 /*     1)  This is a preliminary version of the routine. */
146 
147 /*     2)  Though reference [1] does not specify limitations on the */
148 /*         range of valid time inputs for this precession model, the */
149 /*         fact that the rotation angles used in the model are defined */
150 /*         by polynomials implies that the model is not valid for all */
151 /*         time. */
152 
153 /* $ Literature_References */
154 
155 /*     [1] "Explanatory Supplement to the Astronomical Almanac" */
156 /*          edited by P. Kenneth Seidelmann. University Science */
157 /*          Books, 20 Edgehill Road, Mill Valley, CA 94941 (1992) */
158 
159 /*     [2] "Section 5, Geocentric Space-Fixed Position, Velocity, and */
160 /*         Acceleration Vectors of Tracking Station" by T. D. Moyer. */
161 /*         Draft of JPL Publication documenting the JPL navigation */
162 /*         program "Regres." */
163 
164 
165 /* $ Author_and_Institution */
166 
167 /*     N.J. Bachman       (JPL) */
168 
169 /* $ Version */
170 
171 /* -    Beta Version 1.0.0, 24-SEP-1996 (NJB) */
172 
173 /* -& */
174 /* $ Index_Entries */
175 
176 /*     Earth precession matrix based on 1976 IAU model */
177 
178 /* -& */
179 
180 /*     SPICELIB functions */
181 
182 
183 /*     Local parameters */
184 
185 
186 /*     Local variables */
187 
188 
189 /*     No check-in required; this routine does not participate in */
190 /*     SPICELIB error handling. */
191 
192 
193 /*     Compute the precession angles first.  The time argument has */
194 /*     units of Julian centuries.  The polynomial expressions yield */
195 /*     angles in units of arcseconds prior to scaling.  After scaling, */
196 /*     the angles are in units of radians. */
197 
198     t = *et / (jyear_() * 100.);
199     scale = rpd_() / 3600.;
200     zeta = t * (t * (t * .017998 + .30188) + 2306.2181) * scale;
201     z__ = t * (t * (t * .018203 + 1.09468) + 2306.2181) * scale;
202     theta = t * (t * (t * -.041833 - .42665) + 2004.3109) * scale;
203 
204 /*     Now compute the precession matrix. */
205 
206     d__1 = -z__;
207     d__2 = -zeta;
208     eul2m_(&d__1, &theta, &d__2, &c__3, &c__2, &c__3, precm);
209     return 0;
210 } /* zzeprcss_ */
211 
212