1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.ascending = ascending;
|
7 | exports.descending = descending;
|
8 |
|
9 | var _base = require('./base');
|
10 |
|
11 | var _base2 = _interopRequireDefault(_base);
|
12 |
|
13 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | function ascending(year) {
|
22 |
|
23 | return node(year, 0);
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | function descending(year) {
|
43 |
|
44 | return node(year, 0.5);
|
45 | }
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | function node(y, h) {
|
51 |
|
52 | var k = (y - 2000.05) * 13.4223;
|
53 | k = Math.floor(k - h + 0.5) + h;
|
54 | var p = Math.PI / 180;
|
55 | var ck = 1 / 1342.23;
|
56 | var T = k * ck;
|
57 | var D = _base2.default.horner(T, 183.638 * p, 331.73735682 * p / ck, 0.0014852 * p, 0.00000209 * p, -0.00000001 * p);
|
58 | var M = _base2.default.horner(T, 17.4006 * p, 26.8203725 * p / ck, 0.0001186 * p, 0.00000006 * p);
|
59 | var m_ = _base2.default.horner(T, 38.3776 * p, 355.52747313 * p / ck, 0.0123499 * p, 0.000014627 * p, -0.000000069 * p);
|
60 | var Ω = _base2.default.horner(T, 123.9767 * p, -1.44098956 * p / ck, 0.0020608 * p, 0.00000214 * p, -0.000000016 * p);
|
61 | var V = _base2.default.horner(T, 299.75 * p, 132.85 * p, -0.009173 * p);
|
62 | var P = Ω + 272.75 * p - 2.3 * p * T;
|
63 | var E = _base2.default.horner(T, 1, -0.002516, -0.0000074);
|
64 | return _base2.default.horner(T, 2451565.1619, 27.212220817 / ck, 0.0002762, 0.000000021, -0.000000000088) + -0.4721 * Math.sin(m_) + -0.1649 * Math.sin(2 * D) + -0.0868 * Math.sin(2 * D - m_) + 0.0084 * Math.sin(2 * D + m_) + -0.0083 * Math.sin(2 * D - M) * E + -0.0039 * Math.sin(2 * D - M - m_) * E + 0.0034 * Math.sin(2 * m_) + -0.0031 * Math.sin(2 * (D - m_)) + 0.003 * Math.sin(2 * D + M) * E + 0.0028 * Math.sin(M - m_) * E + 0.0026 * Math.sin(M) * E + 0.0025 * Math.sin(4 * D) + 0.0024 * Math.sin(D) + 0.0022 * Math.sin(M + m_) * E + 0.0017 * Math.sin(Ω) + 0.0014 * Math.sin(4 * D - m_) + 0.0005 * Math.sin(2 * D + M - m_) * E + 0.0004 * Math.sin(2 * D - M + m_) * E + -0.0003 * Math.sin(2 * (D - M)) * E + 0.0003 * Math.sin(4 * D - M) * E + 0.0003 * Math.sin(V) + 0.0003 * Math.sin(P);
|
65 | }
|
66 |
|
67 | exports.default = {
|
68 | ascending: ascending,
|
69 | descending: descending
|
70 | }; |
\ | No newline at end of file |