1 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | import base from './base';
|
16 |
|
17 |
|
18 | export var mercury = 'mercury';
|
19 | export var venus = 'venus';
|
20 | export var earth = 'earth';
|
21 | export var mars = 'mars';
|
22 | export var jupiter = 'jupiter';
|
23 | export var saturn = 'saturn';
|
24 | export var uranus = 'uranus';
|
25 | export var neptune = 'neptune';
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export function Elements(lon, axis, ecc, inc, node, peri) {
|
43 | var o = (typeof lon === 'undefined' ? 'undefined' : _typeof(lon)) === 'object' ? lon : {};
|
44 | this.lon = o.lon || lon;
|
45 | this.axis = o.axis || axis;
|
46 | this.ecc = o.ecc || ecc;
|
47 | this.inc = o.inc || inc;
|
48 | this.node = o.node || node;
|
49 | this.peri = o.peri || peri;
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | var cMean = {
|
56 | mercury: {
|
57 | L: [252.250906, 149474.0722491, 0.0003035, 0.000000018],
|
58 | a: [0.38709831],
|
59 | e: [0.20563175, 0.000020407, -0.0000000283, -0.00000000018],
|
60 | i: [7.004986, 0.0018215, -0.0000181, 0.000000056],
|
61 | Ω: [48.330893, 1.1861883, 0.00017542, 0.000000215],
|
62 | ϖ: [77.456119, 1.5564776, 0.00029544, 0.000000009]
|
63 | },
|
64 | venus: {
|
65 | L: [181.979801, 58519.2130302, 0.00031014, 0.000000015],
|
66 | a: [0.72332982],
|
67 | e: [0.00677192, -0.000047765, 0.0000000981, 0.00000000046],
|
68 | i: [3.394662, 0.0010037, -0.00000088, -0.000000007],
|
69 | Ω: [76.67992, 0.9011206, 0.00040618, -0.000000093],
|
70 | ϖ: [131.563703, 1.4022288, -0.00107618, -0.000005678]
|
71 | },
|
72 | earth: {
|
73 | L: [100.466457, 36000.7698278, 0.00030322, 0.00000002],
|
74 | a: [1.000001018],
|
75 | e: [0.01670863, -0.000042037, -0.0000001267, 0.00000000014],
|
76 | i: [0],
|
77 | Ω: undefined,
|
78 | ϖ: [102.937348, 1.7195366, 0.00045688, -0.000000018]
|
79 | },
|
80 | mars: {
|
81 | L: [355.433, 19141.6964471, 0.00031052, 0.000000016],
|
82 | a: [1.523679342],
|
83 | e: [0.09340065, 0.000090484, -0.0000000806, -0.00000000025],
|
84 | i: [1.849726, -0.0006011, 0.00001276, -0.000000007],
|
85 | Ω: [49.558093, 0.7720959, 0.00001557, 0.000002267],
|
86 | ϖ: [336.060234, 1.8410449, 0.00013477, 0.000000536]
|
87 | },
|
88 | jupiter: {
|
89 | L: [34.351519, 3036.3027748, 0.0002233, 0.000000037],
|
90 | a: [5.202603209, 0.0000001913],
|
91 | e: [0.04849793, 0.000163225, -0.0000004714, -0.00000000201],
|
92 | i: [1.303267, -0.0054965, 0.00000466, -0.000000002],
|
93 | Ω: [100.464407, 1.0209774, 0.00040315, 0.000000404],
|
94 | ϖ: [14.331207, 1.6126352, 0.00103042, -0.000004464]
|
95 | },
|
96 | saturn: {
|
97 | L: [50.077444, 1223.5110686, 0.00051908, -0.00000003],
|
98 | a: [9.554909192, -0.0000021390, 0.000000004],
|
99 | e: [0.05554814, -0.000346641, -0.0000006436, 0.0000000034],
|
100 | i: [2.488879, -0.0037362, -0.00001519, 0.000000087],
|
101 | Ω: [113.665503, 0.877088, -0.00012176, -0.000002249],
|
102 | ϖ: [93.057237, 1.9637613, 0.00083753, 0.000004928]
|
103 | },
|
104 | uranus: {
|
105 | L: [314.055005, 429.8640561, 0.0003039, 0.000000026],
|
106 | a: [19.218446062, -0.0000000372, 0.00000000098],
|
107 | e: [0.04638122, -0.000027293, 0.0000000789, 0.00000000024],
|
108 | i: [0.773197, 0.0007744, 0.00003749, -0.000000092],
|
109 | Ω: [74.005957, 0.5211278, 0.00133947, 0.000018484],
|
110 | ϖ: [173.005291, 1.486379, 0.00021406, 0.000000434]
|
111 | },
|
112 | neptune: {
|
113 | L: [304.348665, 219.8833092, 0.00030882, 0.000000018],
|
114 | a: [30.110386869, -0.0000001663, 0.00000000069],
|
115 | e: [0.00945575, 0.000006033, 0, -0.00000000005],
|
116 | i: [1.769953, -0.0093082, -0.00000708, 0.000000027],
|
117 | Ω: [131.784057, 1.1022039, 0.00025952, -0.000000637],
|
118 | ϖ: [48.120276, 1.4262957, 0.00038434, 0.00000002]
|
119 | }
|
120 |
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | };export function mean(p, jde, e) {
|
133 | var T = base.J2000Century(jde);
|
134 | var c = cMean[p];
|
135 | e = e || new Elements();
|
136 | e.lon = base.pmod(base.horner(T, c.L) * Math.PI / 180, 2 * Math.PI);
|
137 | e.axis = base.horner(T, c.a);
|
138 | e.ecc = base.horner(T, c.e);
|
139 | e.inc = base.horner(T, c.i) * Math.PI / 180;
|
140 | e.node = base.horner(T, c.Ω) * Math.PI / 180;
|
141 | e.peri = base.horner(T, c.ϖ) * Math.PI / 180;
|
142 | return e;
|
143 | }
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 | export function inc(p, jde) {
|
152 |
|
153 | return base.horner(base.J2000Century(jde), cMean[p].i) * Math.PI / 180;
|
154 | }
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | export function node(p, jde) {
|
163 |
|
164 | return base.horner(base.J2000Century(jde), cMean[p].Ω) * Math.PI / 180;
|
165 | }
|
166 |
|
167 | export default {
|
168 | mercury: mercury,
|
169 | venus: venus,
|
170 | earth: earth,
|
171 | mars: mars,
|
172 | jupiter: jupiter,
|
173 | saturn: saturn,
|
174 | uranus: uranus,
|
175 | neptune: neptune,
|
176 | Elements: Elements,
|
177 | mean: mean,
|
178 | inc: inc,
|
179 | node: node
|
180 | }; |
\ | No newline at end of file |