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

Definition at line 3 of file nut00b.c.

References ERFA_D2PI, ERFA_DAS2R, ERFA_DJ00, ERFA_DJC, ERFA_DMAS2R, ERFA_TURNAS, i, and t.

Referenced by eraEe00b(), eraPn00b(), and t_nut00b().

122 {
123  double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
124  dpsils, depsls, dpsipl, depspl;
125  int i;
126 
127 /* Units of 0.1 microarcsecond to radians */
128  static const double U2R = ERFA_DAS2R / 1e7;
129 
130 /* ---------------------------------------- */
131 /* Fixed offsets in lieu of planetary terms */
132 /* ---------------------------------------- */
133 
134  static const double DPPLAN = -0.135 * ERFA_DMAS2R;
135  static const double DEPLAN = 0.388 * ERFA_DMAS2R;
136 
137 /* --------------------------------------------------- */
138 /* Luni-solar nutation: argument and term coefficients */
139 /* --------------------------------------------------- */
140 
141 /* The units for the sine and cosine coefficients are */
142 /* 0.1 microarcsec and the same per Julian century */
143 
144  static const struct {
145  int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
146  double ps,pst,pc; /* longitude sin, t*sin, cos coefficients */
147  double ec,ect,es; /* obliquity cos, t*cos, sin coefficients */
148 
149  } x[] = {
150 
151  /* 1-10 */
152  { 0, 0, 0, 0,1,
153  -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0},
154  { 0, 0, 2,-2,2,
155  -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0},
156  { 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0},
157  { 0, 0, 0, 0,2,2074554.0, 207.0, -698.0,-897492.0, 470.0,-291.0},
158  { 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0},
159  { 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0},
160  { 1, 0, 0, 0,0, 711159.0, 73.0, -872.0, -6750.0, 0.0, 358.0},
161  { 0, 0, 2, 0,1,-387298.0, -367.0, 380.0, 200728.0, 18.0, 318.0},
162  { 1, 0, 2, 0,2,-301461.0, -36.0, 816.0, 129025.0, -63.0, 367.0},
163  { 0,-1, 2,-2,2, 215829.0, -494.0, 111.0, -95929.0, 299.0, 132.0},
164 
165  /* 11-20 */
166  { 0, 0, 2,-2,1, 128227.0, 137.0, 181.0, -68982.0, -9.0, 39.0},
167  {-1, 0, 2, 0,2, 123457.0, 11.0, 19.0, -53311.0, 32.0, -4.0},
168  {-1, 0, 0, 2,0, 156994.0, 10.0, -168.0, -1235.0, 0.0, 82.0},
169  { 1, 0, 0, 0,1, 63110.0, 63.0, 27.0, -33228.0, 0.0, -9.0},
170  {-1, 0, 0, 0,1, -57976.0, -63.0, -189.0, 31429.0, 0.0, -75.0},
171  {-1, 0, 2, 2,2, -59641.0, -11.0, 149.0, 25543.0, -11.0, 66.0},
172  { 1, 0, 2, 0,1, -51613.0, -42.0, 129.0, 26366.0, 0.0, 78.0},
173  {-2, 0, 2, 0,1, 45893.0, 50.0, 31.0, -24236.0, -10.0, 20.0},
174  { 0, 0, 0, 2,0, 63384.0, 11.0, -150.0, -1220.0, 0.0, 29.0},
175  { 0, 0, 2, 2,2, -38571.0, -1.0, 158.0, 16452.0, -11.0, 68.0},
176 
177  /* 21-30 */
178  { 0,-2, 2,-2,2, 32481.0, 0.0, 0.0, -13870.0, 0.0, 0.0},
179  {-2, 0, 0, 2,0, -47722.0, 0.0, -18.0, 477.0, 0.0, -25.0},
180  { 2, 0, 2, 0,2, -31046.0, -1.0, 131.0, 13238.0, -11.0, 59.0},
181  { 1, 0, 2,-2,2, 28593.0, 0.0, -1.0, -12338.0, 10.0, -3.0},
182  {-1, 0, 2, 0,1, 20441.0, 21.0, 10.0, -10758.0, 0.0, -3.0},
183  { 2, 0, 0, 0,0, 29243.0, 0.0, -74.0, -609.0, 0.0, 13.0},
184  { 0, 0, 2, 0,0, 25887.0, 0.0, -66.0, -550.0, 0.0, 11.0},
185  { 0, 1, 0, 0,1, -14053.0, -25.0, 79.0, 8551.0, -2.0, -45.0},
186  {-1, 0, 0, 2,1, 15164.0, 10.0, 11.0, -8001.0, 0.0, -1.0},
187  { 0, 2, 2,-2,2, -15794.0, 72.0, -16.0, 6850.0, -42.0, -5.0},
188 
189  /* 31-40 */
190  { 0, 0,-2, 2,0, 21783.0, 0.0, 13.0, -167.0, 0.0, 13.0},
191  { 1, 0, 0,-2,1, -12873.0, -10.0, -37.0, 6953.0, 0.0, -14.0},
192  { 0,-1, 0, 0,1, -12654.0, 11.0, 63.0, 6415.0, 0.0, 26.0},
193  {-1, 0, 2, 2,1, -10204.0, 0.0, 25.0, 5222.0, 0.0, 15.0},
194  { 0, 2, 0, 0,0, 16707.0, -85.0, -10.0, 168.0, -1.0, 10.0},
195  { 1, 0, 2, 2,2, -7691.0, 0.0, 44.0, 3268.0, 0.0, 19.0},
196  {-2, 0, 2, 0,0, -11024.0, 0.0, -14.0, 104.0, 0.0, 2.0},
197  { 0, 1, 2, 0,2, 7566.0, -21.0, -11.0, -3250.0, 0.0, -5.0},
198  { 0, 0, 2, 2,1, -6637.0, -11.0, 25.0, 3353.0, 0.0, 14.0},
199  { 0,-1, 2, 0,2, -7141.0, 21.0, 8.0, 3070.0, 0.0, 4.0},
200 
201  /* 41-50 */
202  { 0, 0, 0, 2,1, -6302.0, -11.0, 2.0, 3272.0, 0.0, 4.0},
203  { 1, 0, 2,-2,1, 5800.0, 10.0, 2.0, -3045.0, 0.0, -1.0},
204  { 2, 0, 2,-2,2, 6443.0, 0.0, -7.0, -2768.0, 0.0, -4.0},
205  {-2, 0, 0, 2,1, -5774.0, -11.0, -15.0, 3041.0, 0.0, -5.0},
206  { 2, 0, 2, 0,1, -5350.0, 0.0, 21.0, 2695.0, 0.0, 12.0},
207  { 0,-1, 2,-2,1, -4752.0, -11.0, -3.0, 2719.0, 0.0, -3.0},
208  { 0, 0, 0,-2,1, -4940.0, -11.0, -21.0, 2720.0, 0.0, -9.0},
209  {-1,-1, 0, 2,0, 7350.0, 0.0, -8.0, -51.0, 0.0, 4.0},
210  { 2, 0, 0,-2,1, 4065.0, 0.0, 6.0, -2206.0, 0.0, 1.0},
211  { 1, 0, 0, 2,0, 6579.0, 0.0, -24.0, -199.0, 0.0, 2.0},
212 
213  /* 51-60 */
214  { 0, 1, 2,-2,1, 3579.0, 0.0, 5.0, -1900.0, 0.0, 1.0},
215  { 1,-1, 0, 0,0, 4725.0, 0.0, -6.0, -41.0, 0.0, 3.0},
216  {-2, 0, 2, 0,2, -3075.0, 0.0, -2.0, 1313.0, 0.0, -1.0},
217  { 3, 0, 2, 0,2, -2904.0, 0.0, 15.0, 1233.0, 0.0, 7.0},
218  { 0,-1, 0, 2,0, 4348.0, 0.0, -10.0, -81.0, 0.0, 2.0},
219  { 1,-1, 2, 0,2, -2878.0, 0.0, 8.0, 1232.0, 0.0, 4.0},
220  { 0, 0, 0, 1,0, -4230.0, 0.0, 5.0, -20.0, 0.0, -2.0},
221  {-1,-1, 2, 2,2, -2819.0, 0.0, 7.0, 1207.0, 0.0, 3.0},
222  {-1, 0, 2, 0,0, -4056.0, 0.0, 5.0, 40.0, 0.0, -2.0},
223  { 0,-1, 2, 2,2, -2647.0, 0.0, 11.0, 1129.0, 0.0, 5.0},
224 
225  /* 61-70 */
226  {-2, 0, 0, 0,1, -2294.0, 0.0, -10.0, 1266.0, 0.0, -4.0},
227  { 1, 1, 2, 0,2, 2481.0, 0.0, -7.0, -1062.0, 0.0, -3.0},
228  { 2, 0, 0, 0,1, 2179.0, 0.0, -2.0, -1129.0, 0.0, -2.0},
229  {-1, 1, 0, 1,0, 3276.0, 0.0, 1.0, -9.0, 0.0, 0.0},
230  { 1, 1, 0, 0,0, -3389.0, 0.0, 5.0, 35.0, 0.0, -2.0},
231  { 1, 0, 2, 0,0, 3339.0, 0.0, -13.0, -107.0, 0.0, 1.0},
232  {-1, 0, 2,-2,1, -1987.0, 0.0, -6.0, 1073.0, 0.0, -2.0},
233  { 1, 0, 0, 0,2, -1981.0, 0.0, 0.0, 854.0, 0.0, 0.0},
234  {-1, 0, 0, 1,0, 4026.0, 0.0, -353.0, -553.0, 0.0,-139.0},
235  { 0, 0, 2, 1,2, 1660.0, 0.0, -5.0, -710.0, 0.0, -2.0},
236 
237  /* 71-77 */
238  {-1, 0, 2, 4,2, -1521.0, 0.0, 9.0, 647.0, 0.0, 4.0},
239  {-1, 1, 0, 1,1, 1314.0, 0.0, 0.0, -700.0, 0.0, 0.0},
240  { 0,-2, 2,-2,1, -1283.0, 0.0, 0.0, 672.0, 0.0, 0.0},
241  { 1, 0, 2, 2,1, -1331.0, 0.0, 8.0, 663.0, 0.0, 4.0},
242  {-2, 0, 2, 2,2, 1383.0, 0.0, -2.0, -594.0, 0.0, -2.0},
243  {-1, 0, 0, 0,2, 1405.0, 0.0, 4.0, -610.0, 0.0, 2.0},
244  { 1, 1, 2,-2,2, 1290.0, 0.0, 0.0, -556.0, 0.0, 0.0}
245  };
246 
247 /* Number of terms in the series */
248  const int NLS = (int) (sizeof x / sizeof x[0]);
249 
250 /*--------------------------------------------------------------------*/
251 
252 /* Interval between fundamental epoch J2000.0 and given date (JC). */
253  t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
254 
255 /* --------------------*/
256 /* LUNI-SOLAR NUTATION */
257 /* --------------------*/
258 
259 /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
260 
261 /* Mean anomaly of the Moon. */
262  el = fmod(485868.249036 + (1717915923.2178) * t, ERFA_TURNAS) * ERFA_DAS2R;
263 
264 /* Mean anomaly of the Sun. */
265  elp = fmod(1287104.79305 + (129596581.0481) * t, ERFA_TURNAS) * ERFA_DAS2R;
266 
267 /* Mean argument of the latitude of the Moon. */
268  f = fmod(335779.526232 + (1739527262.8478) * t, ERFA_TURNAS) * ERFA_DAS2R;
269 
270 /* Mean elongation of the Moon from the Sun. */
271  d = fmod(1072260.70369 + (1602961601.2090) * t, ERFA_TURNAS) * ERFA_DAS2R;
272 
273 /* Mean longitude of the ascending node of the Moon. */
274  om = fmod(450160.398036 + (-6962890.5431) * t, ERFA_TURNAS) * ERFA_DAS2R;
275 
276 /* Initialize the nutation values. */
277  dp = 0.0;
278  de = 0.0;
279 
280 /* Summation of luni-solar nutation series (smallest terms first). */
281  for (i = NLS-1; i >= 0; i--) {
282 
283  /* Argument and functions. */
284  arg = fmod( (double)x[i].nl * el +
285  (double)x[i].nlp * elp +
286  (double)x[i].nf * f +
287  (double)x[i].nd * d +
288  (double)x[i].nom * om, ERFA_D2PI );
289  sarg = sin(arg);
290  carg = cos(arg);
291 
292  /* Term. */
293  dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg;
294  de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg;
295  }
296 
297 /* Convert from 0.1 microarcsec units to radians. */
298  dpsils = dp * U2R;
299  depsls = de * U2R;
300 
301 /* ------------------------------*/
302 /* IN LIEU OF PLANETARY NUTATION */
303 /* ------------------------------*/
304 
305 /* Fixed offset to correct for missing terms in truncated series. */
306  dpsipl = DPPLAN;
307  depspl = DEPLAN;
308 
309 /* --------*/
310 /* RESULTS */
311 /* --------*/
312 
313 /* Add luni-solar and planetary components. */
314  *dpsi = dpsils + dpsipl;
315  *deps = depsls + depspl;
316 
317  return;
318 
319 }
#define ERFA_DJ00
Definition: erfam.h:87
int i
Definition: db_dim_client.c:21
#define ERFA_TURNAS
Definition: erfam.h:66
#define ERFA_DAS2R
Definition: erfam.h:60
#define ERFA_DMAS2R
Definition: erfam.h:69
#define ERFA_D2PI
Definition: erfam.h:48
#define ERFA_DJC
Definition: erfam.h:81
TT t
Definition: test_client.c:26

+ Here is the caller graph for this function: