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 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | import base from './base';
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export var Elements = function Elements(inc, node, peri) {
|
31 | _classCallCheck(this, Elements);
|
32 |
|
33 | if ((typeof inc === 'undefined' ? 'undefined' : _typeof(inc)) === 'object') {
|
34 | node = inc.pode;
|
35 | peri = inc.peri;
|
36 | inc = inc.inc;
|
37 | }
|
38 | this.inc = inc || 0;
|
39 | this.node = node || 0;
|
40 | this.peri = peri || 0;
|
41 | };
|
42 |
|
43 |
|
44 | var S = 0.0001139788;
|
45 | var C = 0.9999999935;
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export function reduceB1950ToJ2000(eFrom) {
|
54 | var W = eFrom.node - 174.298782 * Math.PI / 180;
|
55 |
|
56 | var _base$sincos = base.sincos(eFrom.inc),
|
57 | si = _base$sincos[0],
|
58 | ci = _base$sincos[1];
|
59 |
|
60 | var _base$sincos2 = base.sincos(W),
|
61 | sW = _base$sincos2[0],
|
62 | cW = _base$sincos2[1];
|
63 |
|
64 | var A = si * sW;
|
65 | var B = C * si * cW - S * ci;
|
66 | var eTo = new Elements();
|
67 | eTo.inc = Math.asin(Math.hypot(A, B));
|
68 | eTo.node = base.pmod(174.997194 * Math.PI / 180 + Math.atan2(A, B), 2 * Math.PI);
|
69 | eTo.peri = base.pmod(eFrom.peri + Math.atan2(-S * sW, C * si - S * ci * cW), 2 * Math.PI);
|
70 | return eTo;
|
71 | }
|
72 |
|
73 | var Lp = 4.50001688 * Math.PI / 180;
|
74 | var L = 5.19856209 * Math.PI / 180;
|
75 | var J = 0.00651966 * Math.PI / 180;
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | export function reduceB1950FK4ToJ2000FK5(eFrom) {
|
85 | var W = L + eFrom.node;
|
86 |
|
87 | var _base$sincos3 = base.sincos(eFrom.inc),
|
88 | si = _base$sincos3[0],
|
89 | ci = _base$sincos3[1];
|
90 |
|
91 | var _base$sincos4 = base.sincos(J),
|
92 | sJ = _base$sincos4[0],
|
93 | cJ = _base$sincos4[1];
|
94 |
|
95 | var _base$sincos5 = base.sincos(W),
|
96 | sW = _base$sincos5[0],
|
97 | cW = _base$sincos5[1];
|
98 |
|
99 | var eTo = new Elements();
|
100 | eTo.inc = Math.acos(ci * cJ - si * sJ * cW);
|
101 | eTo.node = base.pmod(Math.atan2(si * sW, ci * sJ + si * cJ * cW) - Lp, 2 * Math.PI);
|
102 | eTo.peri = base.pmod(eFrom.peri + Math.atan2(sJ * sW, si * cJ + ci * sJ * cW), 2 * Math.PI);
|
103 | return eTo;
|
104 | }
|
105 |
|
106 | export default {
|
107 | Elements: Elements,
|
108 | reduceB1950ToJ2000: reduceB1950ToJ2000,
|
109 | reduceB1950FK4ToJ2000FK5: reduceB1950FK4ToJ2000FK5
|
110 | }; |
\ | No newline at end of file |