1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); |
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | exports.mean = mean;
|
20 | exports.sum = sum;
|
21 | exports.ms = ms;
|
22 | exports.mercuryInfConj = mercuryInfConj;
|
23 | exports.mercurySupConj = mercurySupConj;
|
24 | exports.venusInfConj = venusInfConj;
|
25 | exports.marsOpp = marsOpp;
|
26 | exports.sumA = sumA;
|
27 | exports.msa = msa;
|
28 | exports.jupiterOpp = jupiterOpp;
|
29 | exports.saturnOpp = saturnOpp;
|
30 | exports.saturnConj = saturnConj;
|
31 | exports.uranusOpp = uranusOpp;
|
32 | exports.neptuneOpp = neptuneOpp;
|
33 | exports.el = el;
|
34 | exports.mercuryEastElongation = mercuryEastElongation;
|
35 | exports.mercuryWestElongation = mercuryWestElongation;
|
36 | exports.marsStation2 = marsStation2;
|
37 |
|
38 | var _base = require('./base');
|
39 |
|
40 | var _base2 = _interopRequireDefault(_base);
|
41 |
|
42 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | function mean(y, a) {
|
49 |
|
50 |
|
51 | var k = Math.floor((365.2425 * y + 1721060 - a.A) / a.B + 0.5);
|
52 | var J = a.A + k * a.B;
|
53 | var M = _base2.default.pmod(a.M0 + k * a.M1, 360) * Math.PI / 180;
|
54 | var T = _base2.default.J2000Century(J);
|
55 | return [J, M, T];
|
56 | }
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | function sum(T, M, c) {
|
62 |
|
63 | var j = _base2.default.horner(T, c[0]);
|
64 | var mm = 0.0;
|
65 | for (var i = 1; i < c.length; i++) {
|
66 | mm += M;
|
67 |
|
68 | var _base$sincos = _base2.default.sincos(mm),
|
69 | _base$sincos2 = _slicedToArray(_base$sincos, 2),
|
70 | smm = _base$sincos2[0],
|
71 | cmm = _base$sincos2[1];
|
72 |
|
73 | j += smm * _base2.default.horner(T, c[i]);
|
74 | i++;
|
75 | j += cmm * _base2.default.horner(T, c[i]);
|
76 | }
|
77 | return j;
|
78 | }
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | function ms(y, a, c) {
|
84 |
|
85 | var _mean = mean(y, a),
|
86 | _mean2 = _slicedToArray(_mean, 3),
|
87 | J = _mean2[0],
|
88 | M = _mean2[1],
|
89 | T = _mean2[2];
|
90 |
|
91 | return J + sum(T, M, c);
|
92 | }
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | function mercuryInfConj(y) {
|
101 |
|
102 | return ms(y, micA, micB);
|
103 | }
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | function mercurySupConj(y) {
|
112 |
|
113 | return ms(y, mscA, mscB);
|
114 | }
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | function venusInfConj(y) {
|
123 |
|
124 | return ms(y, vicA, vicB);
|
125 | }
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 | function marsOpp(y) {
|
134 |
|
135 | return ms(y, moA, moB);
|
136 | }
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | function sumA(T, M, c, aa) {
|
142 |
|
143 | var i = c.length - 2 * aa.length;
|
144 | var j = sum(T, M, c.slice(0, i));
|
145 | for (var k = 0; k < aa.length; k++) {
|
146 | var _base$sincos3 = _base2.default.sincos((aa[k].c + aa[k].f * T) * Math.PI / 180),
|
147 | _base$sincos4 = _slicedToArray(_base$sincos3, 2),
|
148 | _saa = _base$sincos4[0],
|
149 | caa = _base$sincos4[1];
|
150 |
|
151 | j += _saa * _base2.default.horner(T, c[i]);
|
152 | i++;
|
153 | j += caa * _base2.default.horner(T, c[i]);
|
154 | i++;
|
155 | }
|
156 | return j;
|
157 | }
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | function msa(y, a, c, aa) {
|
163 |
|
164 | var _mean3 = mean(y, a),
|
165 | _mean4 = _slicedToArray(_mean3, 3),
|
166 | J = _mean4[0],
|
167 | M = _mean4[1],
|
168 | T = _mean4[2];
|
169 |
|
170 | return J + sumA(T, M, c, aa);
|
171 | }
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 | function jupiterOpp(y) {
|
180 |
|
181 | return msa(y, joA, joB, jaa);
|
182 | }
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 | function saturnOpp(y) {
|
191 |
|
192 | return msa(y, soA, soB, saa);
|
193 | }
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 | function saturnConj(y) {
|
202 |
|
203 | return msa(y, scA, scB, saa);
|
204 | }
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | function uranusOpp(y) {
|
213 |
|
214 | return msa(y, uoA, uoB, uaa);
|
215 | }
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | function neptuneOpp(y) {
|
224 |
|
225 | return msa(y, noA, noB, naa);
|
226 | }
|
227 |
|
228 |
|
229 |
|
230 |
|
231 | function el(y, a, t, e) {
|
232 |
|
233 | var _mean5 = mean(y, micA),
|
234 | _mean6 = _slicedToArray(_mean5, 3),
|
235 | J = _mean6[0],
|
236 | M = _mean6[1],
|
237 | T = _mean6[2];
|
238 |
|
239 | return [J + sum(T, M, t), sum(T, M, e) * Math.PI / 180];
|
240 | }
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | function mercuryEastElongation(y) {
|
249 |
|
250 | return el(y, micA, met, mee);
|
251 | }
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 | function mercuryWestElongation(y) {
|
260 |
|
261 | return el(y, micA, mwt, mwe);
|
262 | }
|
263 |
|
264 | function marsStation2(y) {
|
265 |
|
266 | var _mean7 = mean(y, moA),
|
267 | _mean8 = _slicedToArray(_mean7, 3),
|
268 | J = _mean8[0],
|
269 | M = _mean8[1],
|
270 | T = _mean8[2];
|
271 |
|
272 | return J + sum(T, M, ms2);
|
273 | }
|
274 |
|
275 |
|
276 |
|
277 |
|
278 | function Ca(A, B, M0, M1) {
|
279 | this.A = A;
|
280 | this.B = B;
|
281 | this.M0 = M0;
|
282 | this.M1 = M1;
|
283 | }
|
284 |
|
285 |
|
286 |
|
287 |
|
288 | var micA = new Ca(2451612.023, 115.8774771, 63.5867, 114.2088742);
|
289 | var mscA = new Ca(2451554.084, 115.8774771, 6.4822, 114.2088742);
|
290 | var vicA = new Ca(2451996.706, 583.921361, 82.7311, 215.513058);
|
291 | var moA = new Ca(2452097.382, 779.936104, 181.9573, 48.705244);
|
292 | var joA = new Ca(2451870.628, 398.884046, 318.4681, 33.140229);
|
293 | var soA = new Ca(2451870.17, 378.091904, 318.0172, 12.647487);
|
294 | var scA = new Ca(2451681.124, 378.091904, 131.6934, 12.647487);
|
295 | var uoA = new Ca(2451764.317, 369.656035, 213.6884, 4.333093);
|
296 | var noA = new Ca(2451753.122, 367.486703, 202.6544, 2.194998);
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 | function Caa(c, f) {
|
303 | this.c = c;
|
304 | this.f = f;
|
305 | }
|
306 |
|
307 | var jaa = [new Caa(82.74, 40.76)];
|
308 |
|
309 | var saa = [new Caa(82.74, 40.76), new Caa(29.86, 1181.36), new Caa(14.13, 590.68), new Caa(220.02, 1262.87)];
|
310 |
|
311 | var uaa = [new Caa(207.83, 8.51), new Caa(108.84, 419.96)];
|
312 |
|
313 | var naa = [new Caa(207.83, 8.51), new Caa(276.74, 209.98)];
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 | var micB = [[0.0545, 0.0002], [-6.2008, 0.0074, 0.00003], [-3.275, -0.0197, 0.00001], [0.4737, -0.0052, -0.00001], [0.8111, 0.0033, -0.00002], [0.0037, 0.0018], [-0.1768, 0, 0.00001], [-0.0211, -0.0004], [0.0326, -0.0003], [0.0083, 0.0001], [-0.004, 0.0001]];
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | var mscB = [[-0.0548, -0.0002], [7.3894, -0.01, -0.00003], [3.22, 0.0197, -0.00001], [0.8383, -0.0064, -0.00001], [0.9666, 0.0039, -0.00003], [0.077, -0.0026], [0.2758, 0.0002, -0.00002], [-0.0128, -0.0008], [0.0734, -0.0004, -0.00001], [-0.0122, -0.0002], [0.0173, -0.0002]];
|
328 |
|
329 |
|
330 |
|
331 |
|
332 | var vicB = [[-0.0096, 0.0002, -0.00001], [2.0009, -0.0033, -0.00001], [0.598, -0.0104, 0.00001], [0.0967, -0.0018, -0.00003], [0.0913, 0.0009, -0.00002], [0.0046, -0.0002], [0.0079, 0.0001]];
|
333 |
|
334 |
|
335 |
|
336 |
|
337 | var moB = [[-0.3088, 0, 0.00002], [-17.6965, 0.0363, 0.00005], [18.3131, 0.0467, -0.00006], [-0.2162, -0.0198, -0.00001], [-4.5028, -0.0019, 0.00007], [0.8987, 0.0058, -0.00002], [0.7666, -0.005, -0.00003], [-0.3636, -0.0001, 0.00002], [0.0402, 0.0032], [0.0737, -0.0008], [-0.098, -0.0011]];
|
338 |
|
339 |
|
340 |
|
341 |
|
342 | var joB = [[-0.1029, 0, -0.00009], [-1.9658, -0.0056, 0.00007], [6.1537, 0.021, -0.00006], [-0.2081, -0.0013], [-0.1116, -0.001], [0.0074, 0.0001], [-0.0097, -0.0001], [0, 0.0144, -0.00008], [0.3642, -0.0019, -0.00029]];
|
343 |
|
344 |
|
345 |
|
346 |
|
347 | var soB = [[-0.0209, 0.0006, 0.00023], [4.5795, -0.0312, -0.00017], [1.1462, -0.0351, 0.00011], [0.0985, -0.0015], [0.0733, -0.0031, 0.00001], [0.0025, -0.0001], [0.005, -0.0002], [0, -0.0337, 0.00018], [-0.851, 0.0044, 0.00068], [0, -0.0064, 0.00004], [0.2397, -0.0012, -0.00008], [0, -0.001], [0.1245, 0.0006], [0, 0.0024, -0.00003], [0.0477, -0.0005, -0.00006]];
|
348 |
|
349 |
|
350 |
|
351 |
|
352 | var scB = [[0.0172, -0.0006, 0.00023], [-8.5885, 0.0411, 0.00020], [-1.147, 0.0352, -0.00011], [0.3331, -0.0034, -0.00001], [0.1145, -0.0045, 0.00002], [-0.0169, 0.0002], [-0.0109, 0.0004], [0, -0.0337, 0.00018], [-0.851, 0.0044, 0.00068], [0, -0.0064, 0.00004], [0.2397, -0.0012, -0.00008], [0, -0.001], [0.1245, 0.0006], [0, 0.0024, -0.00003], [0.0477, -0.0005, -0.00006]];
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | var uoB = [[0.0844, -0.0006], [-0.1048, 0.0246], [-5.1221, 0.0104, 0.00003], [-0.1428, 0.0005], [-0.0148, -0.0013], [0], [0.0055], [0], [0.885], [0], [0.2153]];
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | var noB = [[-0.014, 0, 0.00001], [-1.3486, 0.001, 0.00001], [0.8597, 0.0037], [-0.0082, -0.0002, 0.00001], [0.0037, -0.0003], [0], [-0.5964], [0], [0.0728]];
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 | var met = [[-21.6106, 0.0002], [-1.9803, -0.006, 0.00001], [1.4151, -0.0072, -0.00001], [0.5528, -0.0005, -0.00001], [0.2905, 0.0034, 0.00001], [-0.1121, -0.0001, 0.00001], [-0.0098, -0.0015], [0.0192], [0.0111, 0.0004], [-0.0061], [-0.0032, -0.0001]];
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | var mee = [[22.4697], [-4.2666, 0.0054, 0.00002], [-1.8537, -0.0137], [0.3598, 0.0008, -0.00001], [-0.068, 0.0026], [-0.0524, -0.0003], [0.0052, -0.0006], [0.0107, 0.0001], [-0.0013, 0.0001], [-0.0021], [0.0003]];
|
377 |
|
378 |
|
379 |
|
380 |
|
381 | var mwt = [[21.6249, -0.0002], [0.1306, 0.0065], [-2.7661, -0.0011, 0.00001], [0.2438, -0.0024, -0.00001], [0.5767, 0.0023], [0.1041], [-0.0184, 0.0007], [-0.0051, -0.0001], [0.0048, 0.0001], [0.0026], [0.0037]];
|
382 |
|
383 |
|
384 |
|
385 |
|
386 | var mwe = [[22.4143, -0.0001], [4.3651, -0.0048, -0.00002], [2.3787, 0.0121, -0.00001], [0.2674, 0.0022], [-0.3873, 0.0008, 0.00001], [-0.0369, -0.0001], [0.0017, -0.0001], [0.0059], [0.0061, 0.0001], [0.0007], [-0.0011]];
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | var ms2 = [[36.7191, 0.0016, 0.00003], [-12.6163, 0.0417, -0.00001], [20.1218, 0.0379, -0.00006], [-1.636, -0.019], [-3.9657, 0.0045, 0.00007], [1.1546, 0.0029, -0.00003], [0.2888, -0.0073, -0.00002], [-0.3128, 0.0017, 0.00002], [0.2513, 0.0026, -0.00002], [-0.0021, -0.0016], [-0.1497, -0.0006]];
|
396 |
|
397 | exports.default = {
|
398 | mean: mean,
|
399 | sum: sum,
|
400 | ms: ms,
|
401 | mercuryInfConj: mercuryInfConj,
|
402 | mercurySupConj: mercurySupConj,
|
403 | venusInfConj: venusInfConj,
|
404 | marsOpp: marsOpp,
|
405 | sumA: sumA,
|
406 | msa: msa,
|
407 | jupiterOpp: jupiterOpp,
|
408 | saturnOpp: saturnOpp,
|
409 | saturnConj: saturnConj,
|
410 | uranusOpp: uranusOpp,
|
411 | neptuneOpp: neptuneOpp,
|
412 | el: el,
|
413 | mercuryEastElongation: mercuryEastElongation,
|
414 | mercuryWestElongation: mercuryWestElongation,
|
415 | marsStation2: marsStation2
|
416 | }; |
\ | No newline at end of file |