FACT++  1.0
void eraNut80 ( double  date1,
double  date2,
double *  dpsi,
double *  deps 
)

Definition at line 3 of file nut80.c.

References eraAnpm(), ERFA_D2PI, ERFA_DAS2R, ERFA_DJ00, ERFA_DJC, and t.

Referenced by eraEqeq94(), eraNutm80(), and t_nut80().

54 {
55  double t, el, elp, f, d, om, dp, de, arg, s, c;
56  int j;
57 
58 /* Units of 0.1 milliarcsecond to radians */
59  const double U2R = ERFA_DAS2R / 1e4;
60 
61 /* ------------------------------------------------ */
62 /* Table of multiples of arguments and coefficients */
63 /* ------------------------------------------------ */
64 
65 /* The units for the sine and cosine coefficients are 0.1 mas and */
66 /* the same per Julian century */
67 
68  static const struct {
69  int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
70  double sp,spt; /* longitude sine, 1 and t coefficients */
71  double ce,cet; /* obliquity cosine, 1 and t coefficients */
72  } x[] = {
73 
74  /* 1-10 */
75  { 0, 0, 0, 0, 1, -171996.0, -174.2, 92025.0, 8.9 },
76  { 0, 0, 0, 0, 2, 2062.0, 0.2, -895.0, 0.5 },
77  { -2, 0, 2, 0, 1, 46.0, 0.0, -24.0, 0.0 },
78  { 2, 0, -2, 0, 0, 11.0, 0.0, 0.0, 0.0 },
79  { -2, 0, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 },
80  { 1, -1, 0, -1, 0, -3.0, 0.0, 0.0, 0.0 },
81  { 0, -2, 2, -2, 1, -2.0, 0.0, 1.0, 0.0 },
82  { 2, 0, -2, 0, 1, 1.0, 0.0, 0.0, 0.0 },
83  { 0, 0, 2, -2, 2, -13187.0, -1.6, 5736.0, -3.1 },
84  { 0, 1, 0, 0, 0, 1426.0, -3.4, 54.0, -0.1 },
85 
86  /* 11-20 */
87  { 0, 1, 2, -2, 2, -517.0, 1.2, 224.0, -0.6 },
88  { 0, -1, 2, -2, 2, 217.0, -0.5, -95.0, 0.3 },
89  { 0, 0, 2, -2, 1, 129.0, 0.1, -70.0, 0.0 },
90  { 2, 0, 0, -2, 0, 48.0, 0.0, 1.0, 0.0 },
91  { 0, 0, 2, -2, 0, -22.0, 0.0, 0.0, 0.0 },
92  { 0, 2, 0, 0, 0, 17.0, -0.1, 0.0, 0.0 },
93  { 0, 1, 0, 0, 1, -15.0, 0.0, 9.0, 0.0 },
94  { 0, 2, 2, -2, 2, -16.0, 0.1, 7.0, 0.0 },
95  { 0, -1, 0, 0, 1, -12.0, 0.0, 6.0, 0.0 },
96  { -2, 0, 0, 2, 1, -6.0, 0.0, 3.0, 0.0 },
97 
98  /* 21-30 */
99  { 0, -1, 2, -2, 1, -5.0, 0.0, 3.0, 0.0 },
100  { 2, 0, 0, -2, 1, 4.0, 0.0, -2.0, 0.0 },
101  { 0, 1, 2, -2, 1, 4.0, 0.0, -2.0, 0.0 },
102  { 1, 0, 0, -1, 0, -4.0, 0.0, 0.0, 0.0 },
103  { 2, 1, 0, -2, 0, 1.0, 0.0, 0.0, 0.0 },
104  { 0, 0, -2, 2, 1, 1.0, 0.0, 0.0, 0.0 },
105  { 0, 1, -2, 2, 0, -1.0, 0.0, 0.0, 0.0 },
106  { 0, 1, 0, 0, 2, 1.0, 0.0, 0.0, 0.0 },
107  { -1, 0, 0, 1, 1, 1.0, 0.0, 0.0, 0.0 },
108  { 0, 1, 2, -2, 0, -1.0, 0.0, 0.0, 0.0 },
109 
110  /* 31-40 */
111  { 0, 0, 2, 0, 2, -2274.0, -0.2, 977.0, -0.5 },
112  { 1, 0, 0, 0, 0, 712.0, 0.1, -7.0, 0.0 },
113  { 0, 0, 2, 0, 1, -386.0, -0.4, 200.0, 0.0 },
114  { 1, 0, 2, 0, 2, -301.0, 0.0, 129.0, -0.1 },
115  { 1, 0, 0, -2, 0, -158.0, 0.0, -1.0, 0.0 },
116  { -1, 0, 2, 0, 2, 123.0, 0.0, -53.0, 0.0 },
117  { 0, 0, 0, 2, 0, 63.0, 0.0, -2.0, 0.0 },
118  { 1, 0, 0, 0, 1, 63.0, 0.1, -33.0, 0.0 },
119  { -1, 0, 0, 0, 1, -58.0, -0.1, 32.0, 0.0 },
120  { -1, 0, 2, 2, 2, -59.0, 0.0, 26.0, 0.0 },
121 
122  /* 41-50 */
123  { 1, 0, 2, 0, 1, -51.0, 0.0, 27.0, 0.0 },
124  { 0, 0, 2, 2, 2, -38.0, 0.0, 16.0, 0.0 },
125  { 2, 0, 0, 0, 0, 29.0, 0.0, -1.0, 0.0 },
126  { 1, 0, 2, -2, 2, 29.0, 0.0, -12.0, 0.0 },
127  { 2, 0, 2, 0, 2, -31.0, 0.0, 13.0, 0.0 },
128  { 0, 0, 2, 0, 0, 26.0, 0.0, -1.0, 0.0 },
129  { -1, 0, 2, 0, 1, 21.0, 0.0, -10.0, 0.0 },
130  { -1, 0, 0, 2, 1, 16.0, 0.0, -8.0, 0.0 },
131  { 1, 0, 0, -2, 1, -13.0, 0.0, 7.0, 0.0 },
132  { -1, 0, 2, 2, 1, -10.0, 0.0, 5.0, 0.0 },
133 
134  /* 51-60 */
135  { 1, 1, 0, -2, 0, -7.0, 0.0, 0.0, 0.0 },
136  { 0, 1, 2, 0, 2, 7.0, 0.0, -3.0, 0.0 },
137  { 0, -1, 2, 0, 2, -7.0, 0.0, 3.0, 0.0 },
138  { 1, 0, 2, 2, 2, -8.0, 0.0, 3.0, 0.0 },
139  { 1, 0, 0, 2, 0, 6.0, 0.0, 0.0, 0.0 },
140  { 2, 0, 2, -2, 2, 6.0, 0.0, -3.0, 0.0 },
141  { 0, 0, 0, 2, 1, -6.0, 0.0, 3.0, 0.0 },
142  { 0, 0, 2, 2, 1, -7.0, 0.0, 3.0, 0.0 },
143  { 1, 0, 2, -2, 1, 6.0, 0.0, -3.0, 0.0 },
144  { 0, 0, 0, -2, 1, -5.0, 0.0, 3.0, 0.0 },
145 
146  /* 61-70 */
147  { 1, -1, 0, 0, 0, 5.0, 0.0, 0.0, 0.0 },
148  { 2, 0, 2, 0, 1, -5.0, 0.0, 3.0, 0.0 },
149  { 0, 1, 0, -2, 0, -4.0, 0.0, 0.0, 0.0 },
150  { 1, 0, -2, 0, 0, 4.0, 0.0, 0.0, 0.0 },
151  { 0, 0, 0, 1, 0, -4.0, 0.0, 0.0, 0.0 },
152  { 1, 1, 0, 0, 0, -3.0, 0.0, 0.0, 0.0 },
153  { 1, 0, 2, 0, 0, 3.0, 0.0, 0.0, 0.0 },
154  { 1, -1, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 },
155  { -1, -1, 2, 2, 2, -3.0, 0.0, 1.0, 0.0 },
156  { -2, 0, 0, 0, 1, -2.0, 0.0, 1.0, 0.0 },
157 
158  /* 71-80 */
159  { 3, 0, 2, 0, 2, -3.0, 0.0, 1.0, 0.0 },
160  { 0, -1, 2, 2, 2, -3.0, 0.0, 1.0, 0.0 },
161  { 1, 1, 2, 0, 2, 2.0, 0.0, -1.0, 0.0 },
162  { -1, 0, 2, -2, 1, -2.0, 0.0, 1.0, 0.0 },
163  { 2, 0, 0, 0, 1, 2.0, 0.0, -1.0, 0.0 },
164  { 1, 0, 0, 0, 2, -2.0, 0.0, 1.0, 0.0 },
165  { 3, 0, 0, 0, 0, 2.0, 0.0, 0.0, 0.0 },
166  { 0, 0, 2, 1, 2, 2.0, 0.0, -1.0, 0.0 },
167  { -1, 0, 0, 0, 2, 1.0, 0.0, -1.0, 0.0 },
168  { 1, 0, 0, -4, 0, -1.0, 0.0, 0.0, 0.0 },
169 
170  /* 81-90 */
171  { -2, 0, 2, 2, 2, 1.0, 0.0, -1.0, 0.0 },
172  { -1, 0, 2, 4, 2, -2.0, 0.0, 1.0, 0.0 },
173  { 2, 0, 0, -4, 0, -1.0, 0.0, 0.0, 0.0 },
174  { 1, 1, 2, -2, 2, 1.0, 0.0, -1.0, 0.0 },
175  { 1, 0, 2, 2, 1, -1.0, 0.0, 1.0, 0.0 },
176  { -2, 0, 2, 4, 2, -1.0, 0.0, 1.0, 0.0 },
177  { -1, 0, 4, 0, 2, 1.0, 0.0, 0.0, 0.0 },
178  { 1, -1, 0, -2, 0, 1.0, 0.0, 0.0, 0.0 },
179  { 2, 0, 2, -2, 1, 1.0, 0.0, -1.0, 0.0 },
180  { 2, 0, 2, 2, 2, -1.0, 0.0, 0.0, 0.0 },
181 
182  /* 91-100 */
183  { 1, 0, 0, 2, 1, -1.0, 0.0, 0.0, 0.0 },
184  { 0, 0, 4, -2, 2, 1.0, 0.0, 0.0, 0.0 },
185  { 3, 0, 2, -2, 2, 1.0, 0.0, 0.0, 0.0 },
186  { 1, 0, 2, -2, 0, -1.0, 0.0, 0.0, 0.0 },
187  { 0, 1, 2, 0, 1, 1.0, 0.0, 0.0, 0.0 },
188  { -1, -1, 0, 2, 1, 1.0, 0.0, 0.0, 0.0 },
189  { 0, 0, -2, 0, 1, -1.0, 0.0, 0.0, 0.0 },
190  { 0, 0, 2, -1, 2, -1.0, 0.0, 0.0, 0.0 },
191  { 0, 1, 0, 2, 0, -1.0, 0.0, 0.0, 0.0 },
192  { 1, 0, -2, -2, 0, -1.0, 0.0, 0.0, 0.0 },
193 
194  /* 101-106 */
195  { 0, -1, 2, 0, 1, -1.0, 0.0, 0.0, 0.0 },
196  { 1, 1, 0, -2, 1, -1.0, 0.0, 0.0, 0.0 },
197  { 1, 0, -2, 2, 0, -1.0, 0.0, 0.0, 0.0 },
198  { 2, 0, 0, 2, 0, 1.0, 0.0, 0.0, 0.0 },
199  { 0, 0, 2, 4, 2, -1.0, 0.0, 0.0, 0.0 },
200  { 0, 1, 0, 1, 0, 1.0, 0.0, 0.0, 0.0 }
201  };
202 
203 /* Number of terms in the series */
204  const int NT = (int) (sizeof x / sizeof x[0]);
205 
206 /*--------------------------------------------------------------------*/
207 
208 /* Interval between fundamental epoch J2000.0 and given date (JC). */
209  t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
210 
211 /* --------------------- */
212 /* Fundamental arguments */
213 /* --------------------- */
214 
215 /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
216  el = eraAnpm(
217  (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
218  * ERFA_DAS2R + fmod(1325.0 * t, 1.0) * ERFA_D2PI);
219 
220 /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
221  elp = eraAnpm(
222  (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
223  * ERFA_DAS2R + fmod(99.0 * t, 1.0) * ERFA_D2PI);
224 
225 /* Mean longitude of Moon minus mean longitude of Moon's node. */
226  f = eraAnpm(
227  (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
228  * ERFA_DAS2R + fmod(1342.0 * t, 1.0) * ERFA_D2PI);
229 
230 /* Mean elongation of Moon from Sun. */
231  d = eraAnpm(
232  (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
233  * ERFA_DAS2R + fmod(1236.0 * t, 1.0) * ERFA_D2PI);
234 
235 /* Longitude of the mean ascending node of the lunar orbit on the */
236 /* ecliptic, measured from the mean equinox of date. */
237  om = eraAnpm(
238  (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
239  * ERFA_DAS2R + fmod(-5.0 * t, 1.0) * ERFA_D2PI);
240 
241 /* --------------- */
242 /* Nutation series */
243 /* --------------- */
244 
245 /* Initialize nutation components. */
246  dp = 0.0;
247  de = 0.0;
248 
249 /* Sum the nutation terms, ending with the biggest. */
250  for (j = NT-1; j >= 0; j--) {
251 
252  /* Form argument for current term. */
253  arg = (double)x[j].nl * el
254  + (double)x[j].nlp * elp
255  + (double)x[j].nf * f
256  + (double)x[j].nd * d
257  + (double)x[j].nom * om;
258 
259  /* Accumulate current nutation term. */
260  s = x[j].sp + x[j].spt * t;
261  c = x[j].ce + x[j].cet * t;
262  if (s != 0.0) dp += s * sin(arg);
263  if (c != 0.0) de += c * cos(arg);
264  }
265 
266 /* Convert results from 0.1 mas units to radians. */
267  *dpsi = dp * U2R;
268  *deps = de * U2R;
269 
270  return;
271 
272 }
#define ERFA_DJ00
Definition: erfam.h:87
#define ERFA_DAS2R
Definition: erfam.h:60
#define ERFA_D2PI
Definition: erfam.h:48
#define ERFA_DJC
Definition: erfam.h:81
double eraAnpm(double a)
Definition: anpm.c:3
TT t
Definition: test_client.c:26
if(extraDns) new Dns

+ Here is the call graph for this function:

+ Here is the caller graph for this function: