• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skyobjects
jupitermoons.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  jupitermoons.cpp - description
3  -------------------
4  begin : Fri Oct 18 2002
5  copyright : (C) 2002 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "jupitermoons.h"
19 
20 #include "ksnumbers.h"
21 #include "ksplanetbase.h"
22 #include "kssun.h"
23 #include "trailobject.h"
24 
25 JupiterMoons::JupiterMoons(){
26  //Initialize the Moon objects. The magnitude data are from the
27  //wikipedia articles for each moon, as of Oct 2007.
28  Moon.append( new TrailObject( SkyObject::MOON, 0.0, 0.0, 5.0, i18nc( "Jupiter's moon Io", "Io" ) ) );
29  Moon.append( new TrailObject( SkyObject::MOON, 0.0, 0.0, 5.3, i18nc( "Jupiter's moon Europa", "Europa" ) ) );
30  Moon.append( new TrailObject( SkyObject::MOON, 0.0, 0.0, 4.6, i18nc( "Jupiter's moon Ganymede", "Ganymede" ) ) );
31  Moon.append( new TrailObject( SkyObject::MOON, 0.0, 0.0, 5.7, i18nc( "Jupiter's moon Callisto", "Callisto" ) ) );
32 
33  XP = QVector<double>(4, 0.0);
34  YP = QVector<double>(4, 0.0);
35  ZP = QVector<double>(4, 0.0);
36  InFront = QVector<bool>(4, false);
37 }
38 
39 JupiterMoons::~JupiterMoons(){
40 }
41 
42 void JupiterMoons::findPosition( const KSNumbers *num, const KSPlanetBase *Jupiter, const KSSun *Sun ) {
43  double Xj, Yj, Zj, Rj;
44  double sinJB, cosJB, sinJL, cosJL;
45  double sinSB, cosSB, sinSL, cosSL;
46  double D, t, tdelay, LAMBDA, ALPHA;
47  double T, oj, fj, ij, pa, tb, I, P;
48 
49  //Satellite position data:
50  //l = mean longitude; Pj = longitude of perijove;
51  //w = long. of the node on Jupiter's equatorial plane
52  //G = Principal inequality in the longitude of Jupiter (whatever that means :)
53  //fl = phase of free libration
54  //z = longitude of node of Jupiter's equator on the ecliptic
55  //Gj/Gs = mean anomalies of Jupiter and Saturn
56  //Pj = Longitude of the perihelion of Jupiter
57  double l1, l2, l3, l4, p1, p2, p3, p4, w1, w2, w3, w4, G, fl, z, Gj, Gs, Pj;
58 
59  //L/B = true longitude/latitude of satellites
60  double S1, S2, S3, S4, L1, L2, L3, L4, b1, b2, b3, b4, R1, R2, R3, R4;
61  double X[5], Y[5], Z[5];
62  double A1[5], B1[5], C1[5];
63  double A2[5], B2[5], C2[5];
64  double A3[5], B3[5], C3[5];
65  double A4[5], B4[5], C4[5];
66  double A5[5], B5[5], C5[5];
67  double A6[5], B6[5], C6[5];
68 
69  Jupiter->ecLong().SinCos( sinJL, cosJL );
70  Jupiter->ecLat().SinCos( sinJB, cosJB );
71 
72  Sun->ecLong().SinCos( sinSL, cosSL );
73  Sun->ecLat().SinCos( sinSB, cosSB );
74 
75  //Geocentric Rectangular coordinates of Jupiter:
76  Xj = Jupiter->rsun() * cosJB *cosJL + Sun->rsun() * cosSL;
77  Yj = Jupiter->rsun() * cosJB *sinJL + Sun->rsun() * sinSL;
78  Zj = Jupiter->rsun() * sinJB;
79 
80  //Distance and light-travel delay time:
81  //0.0057755183 is the inverse of the speed of light, in days/AU
82  Rj = sqrt(Xj*Xj +Yj*Yj + Zj*Zj );
83  tdelay = 0.0057755183*Rj; //light travel delay, in days
84 
85  LAMBDA = atan2(Yj, Xj);
86  ALPHA = atan2( Zj, sqrt( Xj*Xj + Yj*Yj ) );
87 
88  //days since 10 Aug 1976 0h (minus light-travel delay)
89  t = num->julianDay() - 2443000.5 - tdelay;
90 
91  //Mean longitudes of the satellites:
92  l1 = dms(106.07947 + 203.488955432*t).radians();
93  l2 = dms(175.72938 + 101.374724550*t).radians();
94  l3 = dms(120.55434 + 50.317609110*t).radians();
95  l4 = dms( 84.44868 + 21.571071314*t).radians();
96 
97  //Longitudes of the satellites' Perijoves (point along orbit nearest to Jupiter)
98  p1 = dms( 58.3329 + 0.16103936*t).radians();
99  p2 = dms(132.8959 + 0.04647985*t).radians();
100  p3 = dms(187.2887 + 0.00712740*t).radians();
101  p4 = dms(335.3418 + 0.00183998*t).radians();
102 
103  //Longitudes of the satellites' nodes on the equatorial plane of Jupiter
104  w1 = dms(311.0793 - 0.13279430*t).radians();
105  w2 = dms(100.5099 - 0.03263047*t).radians();
106  w3 = dms(119.1688 - 0.00717704*t).radians();
107  w4 = dms(322.5729 - 0.00175934*t).radians();
108 
109  //Principal inequality in the longitude of Jupiter
110  // G = 0.33033*sin( 163.679 + 0.0010512*t ) + 0.03439*sin( 34.486 - 0.0161731*t );
111  //converted sin args to radians:
112  G = dms(0.33033 * sin( 2.85674 + 0.0000183469*t )
113  + 0.03439 * sin( 0.601894 - 0.000282274*t )).radians();
114 
115  //phase of free libration
116  fl = dms(191.8132 + 0.17390023*t).radians();
117 
118  //longitude of Jupiter's equatorial node on the ecliptic
119  z = dms(316.5182 - 0.00000208*t).radians();
120 
121  //Mean anomalies of Jupiter and Saturn
122  Gj = dms(30.23756 + 0.0830925701*t + G/dms::DegToRad).radians();
123  Gs = dms(31.97853 + 0.0334597339*t).radians();
124 
125  //Longitude of perihelion of Jupiter
126  Pj = dms(13.469942).radians();
127 
128  //***Periodic terms in the longitudes of the satellites
129  S1 = 0.47259 * sin( 2.*( l1 - l2) )
130  - 0.03480 * sin( p3 - p4 )
131  - 0.01756 * sin( p1 + p3 - 2.*Pj - 2.*Gj )
132  + 0.01080 * sin( l2 - 2.*l3 + p3 )
133  + 0.00757 * sin( fl )
134  + 0.00663 * sin( l2 - 2.*l3 + p4 )
135  + 0.00453 * sin( l1 - p3 )
136  + 0.00453 * sin( l2 - 2.*l3 + p2 )
137  - 0.00354 * sin( l1 - l2 )
138  - 0.00317 * sin( 2.*z - 2.*Pj )
139  - 0.00269 * sin( l2 - 2.*l3 + p1 )
140  + 0.00263 * sin( l1 - p4 )
141  + 0.00186 * sin( l1 - p1 )
142  - 0.00186 * sin( Gj )
143  + 0.00167 * sin( p2 - p3 )
144  + 0.00158 * sin( 4.*( l1 - l2 ) )
145  - 0.00155 * sin( l1 - l3 )
146  - 0.00142 * sin( z +w3 - 2.*Pj - 2.*Gj )
147  - 0.00115 * sin( 2.*( l1 - 2.*l2 + w2 ) )
148  + 0.00089 * sin( p2 - p4 )
149  + 0.00084 * sin( w2 - w3 )
150  + 0.00084 * sin( l1 +p3 - 2.*Pj -2.*Gj )
151  + 0.00053 * sin( z - w2 );
152 
153  S2 = 1.06476 * sin( 2.*( l2 - l3 ) )
154  + 0.04253 * sin( l1 - 2.*l2 + p3 )
155  + 0.03579 * sin( l2 - p3 )
156  + 0.02383 * sin( l1 - 2.*l2 + p4 )
157  + 0.01977 * sin( l2 - p4 )
158  - 0.01843 * sin( fl )
159  + 0.01299 * sin( p3 - p4 )
160  - 0.01142 * sin( l2 - l3 )
161  + 0.01078 * sin( l2 - p2 )
162  - 0.01058 * sin( Gj )
163  + 0.00870 * sin( l2 - 2.*l3 + p2 )
164  - 0.00775 * sin( 2.*( z - Pj) )
165  + 0.00524 * sin( 2.*( l1 - l2 ) )
166  - 0.00460 * sin( l1 - l3 )
167  + 0.00450 * sin( l2 - 2.*l3 + p1 )
168  + 0.00327 * sin( z + w3 - 2.*Pj - 2.*Gj )
169  - 0.00296 * sin( p1 +p3 - 2.*Pj - 2.*Gj )
170  - 0.00151 * sin( 2.*Gj )
171  + 0.00146 * sin( z - w3 )
172  + 0.00125 * sin( z - w4 )
173  - 0.00117 * sin( l1 - 2.*l3 + p3 )
174  - 0.00095 * sin( 2.*( l2 - w2 ) )
175  + 0.00086 * sin( l1 - 2.*l2 + w2 )
176  - 0.00086 * sin( 5.*Gs - Gj + 0.911497 )
177  - 0.00078 * sin( l2 - l4 )
178  - 0.00064 * sin( l1 - 2.*l3 + p4 )
179  - 0.00063 * sin( 3.*l3 - 7.*l4 + 4.*p4 )
180  + 0.00061 * sin( p1 - p4 )
181  + 0.00058 * sin( 2.*( z - Pj - Gj ) )
182  + 0.00058 * sin( w3 - w4 )
183  + 0.00056 * sin( 2.*( l2 - l4 ) )
184  + 0.00055 * sin( 2.*( l1 - l3 ) )
185  + 0.00052 * sin( 3.*l3 - 7.*l4 + p3 +3.*p4 )
186  - 0.00043 * sin( l1 - p3 )
187  + 0.00042 * sin( p3 - p2 )
188  + 0.00041 * sin( 5.*( l2 -l3 ) )
189  + 0.00041 * sin( p4 - Pj )
190  + 0.00038 * sin( l2 - p1 )
191  + 0.00032 * sin( w2 - w3 )
192  + 0.00032 * sin( 2.*( l3 - Gj - Pj ) )
193  + 0.00029 * sin( p1 - p3 );
194 
195  S3 = 0.16477 * sin( l3 - p3 )
196  + 0.09062 * sin( l3 - p4 )
197  - 0.06907 * sin( l2 - l3 )
198  + 0.03786 * sin( p3 - p4 )
199  + 0.01844 * sin( 2.*( l3 - l4 ) )
200  - 0.01340 * sin( Gj )
201  + 0.00703 * sin( l2 - 2.*l3 + p3 )
202  - 0.00670 * sin( 2.*( z - Pj ) )
203  - 0.00540 * sin( l3 - l4 )
204  + 0.00481 * sin( p1 +p3 - 2.*Pj - 2.*Gj )
205  - 0.00409 * sin( l2 - 2.*l3 + p2 )
206  + 0.00379 * sin( l2 - 2.*l3 + p4 )
207  + 0.00235 * sin( z - w3 )
208  + 0.00198 * sin( z - w4 )
209  + 0.00180 * sin( fl )
210  + 0.00129 * sin( 3.*( l3 - l4 ) )
211  + 0.00124 * sin( l1 - l3 )
212  - 0.00119 * sin( 5.*Gs - 2.*Gj + 0.911497 )
213  + 0.00109 * sin( l1 - l2 )
214  - 0.00099 * sin( 3.*l3 - 7.*l4 + 4.*p4 )
215  + 0.00091 * sin( w3 - w4 )
216  + 0.00081 * sin( 3.*l3 - 7.*l4 + p3 + 3.*p4 )
217  - 0.00076 * sin( 2.*l2 - 3.*l3 + p3 )
218  + 0.00069 * sin( p4 - Pj )
219  - 0.00058 * sin( 2.*l3 - 3.*l4 + p4 )
220  + 0.00057 * sin( l3 + p3 - 2.*Pj -2.*Gj )
221  - 0.00057 * sin( l3 - 2.*l4 + p4 )
222  - 0.00052 * sin( p2 - p3 )
223  - 0.00052 * sin( l2 - 2.*l3 +p1 )
224  + 0.00048 * sin( l3 - 2.*l4 +p3 )
225  - 0.00045 * sin( 2.*l2 - 3.*l3 +p4 )
226  - 0.00041 * sin( p2 - p4 )
227  - 0.00038 * sin( 2.*Gj )
228  - 0.00033 * sin( p3 - p4 + w3 - w4 )
229  - 0.00032 * sin( 3.*l3 - 7.*l4 +2.*p3 +2.*p4 )
230  + 0.00030 * sin( 4.*( l3 - l4 ) )
231  - 0.00029 * sin( w3 + z - 2.*Pj - 2.*Gj )
232  + 0.00029 * sin( l3 + p4 - 2.*Pj - 2.*Gj )
233  + 0.00026 * sin( l3 - Pj - Gj )
234  + 0.00024 * sin( l2 - 3.*l3 + 2.*l4 )
235  + 0.00021 * sin( 2.*( l3 - Pj - Gj ) )
236  - 0.00021 * sin( l3 - p2 )
237  + 0.00017 * sin( 2.*( l3 - p2 ) );
238 
239  S4 = 0.84109 * sin( l4 - p4 )
240  + 0.03429 * sin( p4 - p3 )
241  - 0.03305 * sin( 2.*( z - Pj ) )
242  - 0.03211 * sin( Gj )
243  - 0.01860 * sin( l4 - p3 )
244  + 0.01182 * sin( z - w4 )
245  + 0.00622 * sin( l4 + p4 - 2.*Gj - 2.*Pj )
246  + 0.00385 * sin( 2.*( l4 - p4 ) )
247  - 0.00284 * sin( 5.*Gs - 2.*Gj + + 0.911497 )
248  - 0.00233 * sin( 2.*( z - p4 ) )
249  - 0.00223 * sin( l3 - l4 )
250  - 0.00208 * sin( l4 - Pj )
251  + 0.00177 * sin( z +w4 - 2.*p4 )
252  + 0.00134 * sin( p4 - Pj )
253  + 0.00125 * sin( 2.*( l4 - Gj - Pj ) )
254  - 0.00117 * sin( 2.*Gj )
255  - 0.00112 * sin( 2.*( l3 - l4 ) )
256  + 0.00106 * sin( 3.*l3 - 7.*l4 + 4.*p4 )
257  + 0.00102 * sin( l4 - Gj - Pj )
258  + 0.00096 * sin( 2.*l4 - z - w4 )
259  + 0.00087 * sin( 2.*( z - w4 ) )
260  - 0.00087 * sin( 3.*l3 - 7.*l4 + p3 + 3.*p4 )
261  + 0.00085 * sin( l3 -2.*l4 +p4 )
262  - 0.00081 * sin( 2.*(l4 - z ) )
263  + 0.00071 * sin( l4 + p4 - 2.*Pj - 2.*Gj )
264  + 0.00060 * sin( l1 - l4 )
265  - 0.00056 * sin( z - w3 )
266  - 0.00055 * sin( l3 - 2.*l4 + p3 )
267  + 0.00051 * sin( l2 - l4 )
268  + 0.00042 * sin( 2.*( z - Gj - Pj ) )
269  + 0.00039 * sin( 2.*( p4 - w4 ) )
270  + 0.00036 * sin( z + Pj - p4 - w4 )
271  + 0.00035 * sin( 2.*Gs - Gj + 3.28767 )
272  - 0.00035 * sin( l4 - p4 + 2.*Pj - 2.*z )
273  - 0.00032 * sin( l4 + p4 - 2.*Pj - Gj )
274  + 0.00030 * sin( 3.*l3 - 7.*l4 + 2.*p3 + 2.*p4 )
275  + 0.00030 * sin( 2.*Gs - 2.*Gj + 2.60316 )
276  + 0.00028 * sin( l4 - p4 + 2.*z - 2.*Pj )
277  - 0.00028 * sin( 2.*( l4 - w4 ) )
278  - 0.00027 * sin( p3 - p4 + w3 - w4 )
279  - 0.00026 * sin( 5.*Gs - 3.*Gj + 3.28767 )
280  + 0.00025 * sin( w4 - w3 )
281  - 0.00025 * sin( l2 - 3.*l3 + 2.*l4 )
282  - 0.00023 * sin( 3.*( l3 - l4 ) )
283  + 0.00021 * sin( 2.*l4 - 2.*Pj - 3.*Gj )
284  - 0.00021 * sin( 2.*l3 - 3.*l4 + p4 )
285  + 0.00019 * sin( l4 - p4 - Gj )
286  - 0.00019 * sin( 2.*l4 - p4 +Gj )
287  - 0.00018 * sin( l4 - p4 + Gj )
288  - 0.00016 * sin( l4 + p3 - 2.*Pj - 2.*Gj );
289 
290  //Convert Longitude Sums to Radians:
291  S1 *= dms::DegToRad;
292  S2 *= dms::DegToRad;
293  S3 *= dms::DegToRad;
294  S4 *= dms::DegToRad;
295 
296  L1 = l1 + S1;
297  L2 = l2 + S2;
298  L3 = l3 + S3;
299  L4 = l4 + S4;
300 
301  //Periodic terms in the latitudes of the satellites
302  tb = 0.0006502 * sin( L1 - w1 )
303  + 0.0001835 * sin( L1 - w2 )
304  + 0.0000329 * sin( L1 - w3 )
305  - 0.0000311 * sin( L1 - z )
306  + 0.0000093 * sin( L1 - w4 )
307  + 0.0000075 * sin( 3.*L1 - 4.*l2 - 1.9927*S1 + w2 )
308  + 0.0000046 * sin( L1 +z - 2.*Pj - 2.*Gj );
309  b1 = atan( tb );
310 
311  tb = 0.0081275 * sin( L2 - w2 )
312  + 0.0004512 * sin( L2 - w3 )
313  - 0.0003286 * sin( L2 - z )
314  + 0.0001164 * sin( L2 - w4 )
315  + 0.0000273 * sin( l1 - 2.*l3 + 1.0146*S2 + w2 )
316  + 0.0000143 * sin( L2 + z - 2.*Pj - 2.*Gj )
317  - 0.0000143 * sin( L2 - w1 )
318  + 0.0000035 * sin( L2 - z + Gj )
319  - 0.0000028 * sin( l1 - 2.*l3 +1.0146*S2 + w3 );
320  b2 = atan( tb );
321 
322  tb = 0.0032364 * sin( L3 - w3 )
323  - 0.0016911 * sin( L3 - z )
324  + 0.0006849 * sin( L3 - w4 )
325  - 0.0002806 * sin( L3 - w2 )
326  + 0.0000321 * sin( L3 + z - 2.*Pj - 2.*Gj )
327  + 0.0000051 * sin( L3 - z + Gj )
328  - 0.0000045 * sin( L3 - z - Gj )
329  - 0.0000045 * sin( L3 + z - 2.*Pj )
330  + 0.0000037 * sin( L3 + z - 2.*Pj -3.*Gj )
331  + 0.0000030 * sin( 2.*l2 - 3.*L3 + 4.03*S3 +w2 )
332  - 0.0000021 * sin( 2.*l2 - 3.*L3 + 4.03*S3 +w3 );
333  b3 = atan( tb );
334 
335  tb = -0.0076579 * sin( L4 - z )
336  + 0.0044148 * sin( L4 - w4 )
337  - 0.0005106 * sin( L4 - w3 )
338  + 0.0000773 * sin( L4 + z - 2.*Pj - 2.*Gj )
339  + 0.0000104 * sin( L4 - z + Gj )
340  - 0.0000102 * sin( L4 - z - Gj )
341  + 0.0000088 * sin( L4 + z - 2.*Pj - 3.*Gj )
342  - 0.0000038 * sin( L4 + z - 2.*Pj - Gj );
343  b4 = atan( tb );
344 
345 
346  //Periodic terms in the Radius of the stellites (distance from Jupiter)
347  R1 = 5.90730*( 1.0 +
348  - 0.0041339 * cos( 2.*( l1 - l2 ) )
349  - 0.0000395 * cos( l1 - p3 )
350  - 0.0000214 * cos( l1 - p4 )
351  + 0.0000170 * cos( l1 - l2 )
352  - 0.0000162 * cos( l1 - p1 )
353  - 0.0000130 * cos( 4.*( l1 - l2 ) )
354  + 0.0000106 * cos( l1 - l3 )
355  - 0.0000063 * cos( l1 +p3 - 2.*Pj - 2*Gj ) );
356 
357  R2 = 9.39912*( 1.0 +
358  0.0093847 * cos( l1 - l2 )
359  - 0.0003114 * cos( l2 - p3 )
360  - 0.0001738 * cos( l2 - p4 )
361  - 0.0000941 * cos( l2 - p2 )
362  + 0.0000553 * cos( l2 - l3 )
363  + 0.0000523 * cos( l1 - l3 )
364  - 0.0000290 * cos( 2.*( l1 - l2 ) )
365  + 0.0000166 * cos( 2.*( l2 - w2 ) )
366  + 0.0000107 * cos( l1 - 2.*l3 +p3 )
367  - 0.0000102 * cos( l2 - p1 )
368  - 0.0000091 * cos( 2.*( l1 - l3 ) ) );
369 
370  R3 = 14.99240*( 1.0 +
371  - 0.0014377 * cos( l3 - p3 )
372  - 0.0007904 * cos( l3 - p4 )
373  + 0.0006342 * cos( l2 - l3 )
374  - 0.0001758 * cos( 2.*( l3 - l4 ) )
375  + 0.0000294 * cos( l3 - l4 )
376  - 0.0000156 * cos( 3.*( l3 - l4 ) )
377  + 0.0000155 * cos( l1 - l3 )
378  - 0.0000153 * cos( l1 - l2 )
379  + 0.0000070 * cos( 2.*l2 - 3.*l3 +p3 )
380  - 0.0000051 * cos( l3 +p3 - 2.*Pj - 2.*Gj ) );
381 
382  R4 = 26.36990*( 1.0 +
383  - 0.0073391 * cos( l4 - p4 )
384  + 0.0001620 * cos( l4 - p3 )
385  + 0.0000974 * cos( l3 - l4 )
386  - 0.0000541 * cos( l4 + p4 - 2.*Pj - 2.*Gj )
387  - 0.0000269 * cos( 2.*( l4 - p4 ) )
388  + 0.0000182 * cos( l4 - Pj )
389  + 0.0000177 * cos( 2.*( l3 - l4 ) )
390  - 0.0000167 * cos( 2.*l4 - z - w4 )
391  + 0.0000167 * cos( z - w4 )
392  - 0.0000155 * cos( 2.*( l4 - Pj - Gj ) )
393  + 0.0000142 * cos( 2.*( l4 - z ) )
394  + 0.0000104 * cos( l1 - l4 )
395  + 0.0000092 * cos( l2 - l4 )
396  - 0.0000089 * cos( l4 - Pj - Gj )
397  - 0.0000062 * cos( l4 +p4 - 2.*Pj - 3.*Gj )
398  + 0.0000048 * cos( 2.*( l4 - w4 ) ) );
399 
400 
401  //Inclination of Jupiter's rotational axis since 1900.0
402  t = ( num->julianDay() - 2415020.50 ) / 36525.0;
403  I = dms( 3.120262 +0.0006*t ).radians();
404 
405  //Precession since B1950:
406  t = ( num->julianDay() - 2433282.423 ) / 36525.0;
407  P = dms( 1.3966626*t +0.0003088*t*t ).radians();
408 
409  L1 += P;
410  L2 += P;
411  L3 += P;
412  L4 += P;
413  z += P;
414 
415  X[0] = R1 * cos( L1 - z ) * cos( b1 );
416  X[1] = R2 * cos( L2 - z ) * cos( b2 );
417  X[2] = R3 * cos( L3 - z ) * cos( b3 );
418  X[3] = R4 * cos( L4 - z ) * cos( b4 );
419  Y[0] = R1 * sin( L1 - z ) * cos( b1 );
420  Y[1] = R2 * sin( L2 - z ) * cos( b2 );
421  Y[2] = R3 * sin( L3 - z ) * cos( b3 );
422  Y[3] = R4 * sin( L4 - z ) * cos( b4 );
423  Z[0] = R1 * sin( b1 );
424  Z[1] = R2 * sin( b2 );
425  Z[2] = R3 * sin( b3 );
426  Z[3] = R4 * sin( b4 );
427 
428  //fictional "fifth moon" used later...
429  X[4] = 0.0; Y[4] = 0.0; Z[4] = 1.0;
430 
431  T = num->julianCenturies();
432 
433  oj = dms( 100.464441 + 1.0209550*T + 0.00040117*T*T + 0.000000569*T*T*T ).radians();
434  fj = z - oj;
435  ij = dms( 1.303270 - 0.0054966*T +0.00000465*T*T - 0.000000004*T*T*T ).radians();
436 
437  for ( int i=0; i<5; ++i ) {
438  A1[i] = X[i];
439  B1[i] = Y[i] * cos( I ) - Z[i] * sin( I );
440  C1[i] = Y[i] * sin( I ) + Z[i] * cos( I );
441 
442  A2[i] = A1[i] * cos( fj ) - B1[i] * sin( fj );
443  B2[i] = A1[i] * sin( fj ) + B1[i] * cos( fj );
444  C2[i] = C1[i];
445 
446  A3[i] = A2[i];
447  B3[i] = B2[i] * cos( ij ) - C2[i] * sin( ij );
448  C3[i] = B2[i] * sin( ij ) + C2[i] * cos( ij );
449 
450  A4[i] = A3[i] * cos( oj ) - B3[i] * sin( oj );
451  B4[i] = A3[i] * sin( oj ) + B3[i] * cos( oj );
452  C4[i] = C3[i];
453 
454  A5[i] = A4[i] * sin( LAMBDA ) - B4[i] * cos( LAMBDA );
455  B5[i] = A4[i] * cos( LAMBDA ) + B4[i] * sin( LAMBDA );
456  C5[i] = C4[i];
457 
458  A6[i] = A5[i];
459  B6[i] = C5[i] * sin( ALPHA ) + B5[i] * cos( ALPHA );
460  C6[i] = C5[i] * cos( ALPHA ) - B5[i] * sin( ALPHA );
461 
462  /* DEBUG
463  kDebug() <<"A: "<<i<<": "<<A1[i]<<": "<<A2[i]<<": "<<A3[i]<<": "<<A4[i]<<": "<<A5[i]<<": "<<A6[i];
464  kDebug() <<"B: "<<i<<": "<<B1[i]<<": "<<B2[i]<<": "<<B3[i]<<": "<<B4[i]<<": "<<B5[i]<<": "<<B6[i];
465  kDebug() <<"C: "<<i<<": "<<C1[i]<<": "<<C2[i]<<": "<<C3[i]<<": "<<C4[i]<<": "<<C5[i]<<": "<<C6[i];
466  */
467  }
468 
469  D = atan2( A6[4], C6[4] );
470 
471  //X and Y are now the rectangular coordinates of each satellite,
472  //in units of Jupiter's Equatorial radius.
473  //When Z is negative, the planet is nearer to the Sun than Jupiter.
474 
475  pa = Jupiter->pa()*dms::PI/180.0;
476 
477  for ( int i=0; i<4; ++i ) {
478  XP[i] = A6[i] * cos( D ) - C6[i] * sin( D );
479  YP[i] = A6[i] * sin( D ) + C6[i] * cos( D );
480  ZP[i] = B6[i];
481 
482  Moon[i]->setRA( Jupiter->ra().Hours() - 0.011*( XP[i] * cos( pa ) - YP[i] * sin( pa ) )/15.0 );
483  Moon[i]->setDec( Jupiter->dec().Degrees() - 0.011*( XP[i] * sin( pa ) + YP[i] * cos( pa ) ) );
484 
485  if ( ZP[i] < 0.0 ) InFront[i] = true;
486  else InFront[i] = false;
487 
488  //Update Trails
489  if ( Moon[i]->hasTrail() ) {
490  Moon[i]->addToTrail();
491  if ( Moon[i]->trail().size() > TrailObject::MaxTrail )
492  Moon[i]->clipTrail();
493  }
494  }
495 }
ksplanetbase.h
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
KSSun
Child class of KSPlanetBase; encapsulates information about the Sun.
Definition: kssun.h:31
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
PlanetMoons::XP
QVector< double > XP
Definition: planetmoons.h:124
JupiterMoons::~JupiterMoons
virtual ~JupiterMoons()
Destructor.
Definition: jupitermoons.cpp:39
PlanetMoons::z
double z(int i) const
Definition: planetmoons.h:113
jupitermoons.h
JupiterMoons::JupiterMoons
JupiterMoons()
Constructor.
Definition: jupitermoons.cpp:25
PlanetMoons::ZP
QVector< double > ZP
Definition: planetmoons.h:124
KSPlanetBase::rsun
double rsun() const
Definition: ksplanetbase.h:126
i18nc
i18nc("string from libindi, used in the config dialog","100x")
KSNumbers::julianDay
long double julianDay() const
Definition: ksnumbers.h:93
SkyObject::MOON
Definition: skyobject.h:110
ksnumbers.h
trailobject.h
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
JupiterMoons::findPosition
virtual void findPosition(const KSNumbers *num, const KSPlanetBase *jup, const KSSun *sunptr)
Find the positions of each Moon, relative to Jupiter.
Definition: jupitermoons.cpp:42
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
dms::Hours
double Hours() const
Definition: dms.h:125
KSPlanetBase::ecLat
const dms & ecLat() const
Definition: ksplanetbase.h:94
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
KSPlanetBase::ecLong
const dms & ecLong() const
Definition: ksplanetbase.h:91
PlanetMoons::Moon
QVector< TrailObject * > Moon
Definition: planetmoons.h:121
kssun.h
PI
#define PI
Definition: satellite.cpp:43
TrailObject
provides a SkyObject with an attachable Trail
Definition: trailobject.h:33
KSPlanetBase::pa
virtual double pa() const
Definition: ksplanetbase.h:163
KSPlanetBase
A subclass of TrailObject that provides additional information needed for most solar system objects...
Definition: ksplanetbase.h:63
PlanetMoons::InFront
QVector< bool > InFront
Definition: planetmoons.h:122
KSNumbers::julianCenturies
double julianCenturies() const
Definition: ksnumbers.h:90
TrailObject::MaxTrail
static const int MaxTrail
Maximum trail size.
Definition: trailobject.h:70
PlanetMoons::YP
QVector< double > YP
Definition: planetmoons.h:124
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal