1414namespace deepskylog \AstronomyLibrary \Targets ;
1515
1616use Carbon \Carbon ;
17- use deepskylog \AstronomyLibrary \Time ;
1817use deepskylog \AstronomyLibrary \Coordinates \Coordinate ;
18+ use deepskylog \AstronomyLibrary \Time ;
1919
2020/**
2121 * The target class describing Mercury.
@@ -47,15 +47,15 @@ class Mercury extends Planet
4747 public function calculateMeanOrbitalElements (Carbon $ date )
4848 {
4949 $ jd = Time::getJd ($ date );
50- $ T = ($ jd - 2451545.0 ) / 36525.0 ;
50+ $ T = ($ jd - 2451545.0 ) / 36525.0 ;
5151
52- $ L = (new Coordinate (252.250906 + 149474.0722491 * $ T + 0.00030350 * $ T ** 2 + 0.000000018 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
53- $ a = 0.387098310 ;
54- $ e = 0.20563175 + 0.000020407 * $ T - 0.0000000283 * $ T ** 2 - 0.00000000018 * $ T ** 3 ;
55- $ i = (new Coordinate (7.004986 + 0.0018215 * $ T - 0.00001810 * $ T ** 2 + 0.000000056 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
52+ $ L = (new Coordinate (252.250906 + 149474.0722491 * $ T + 0.00030350 * $ T ** 2 + 0.000000018 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
53+ $ a = 0.387098310 ;
54+ $ e = 0.20563175 + 0.000020407 * $ T - 0.0000000283 * $ T ** 2 - 0.00000000018 * $ T ** 3 ;
55+ $ i = (new Coordinate (7.004986 + 0.0018215 * $ T - 0.00001810 * $ T ** 2 + 0.000000056 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
5656 $ omega = (new Coordinate (48.330893 + 1.1861883 * $ T + 0.00017542 * $ T ** 2 + 0.000000215 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
57- $ pi = (new Coordinate (77.456119 + 1.5564776 * $ T + 0.00029544 * $ T ** 2 + 0.000000009 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
58- $ M = $ L - $ pi ;
57+ $ pi = (new Coordinate (77.456119 + 1.5564776 * $ T + 0.00029544 * $ T ** 2 + 0.000000009 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
58+ $ M = $ L - $ pi ;
5959
6060 return [$ L , $ a , $ e , $ i , $ omega , $ pi , $ M ];
6161 }
@@ -78,15 +78,15 @@ public function calculateMeanOrbitalElements(Carbon $date)
7878 public function calculateMeanOrbitalElementsJ2000 (Carbon $ date )
7979 {
8080 $ jd = Time::getJd ($ date );
81- $ T = ($ jd - 2451545.0 ) / 36525.0 ;
81+ $ T = ($ jd - 2451545.0 ) / 36525.0 ;
8282
83- $ L = (new Coordinate (252.250906 + 149472.6746358 * $ T - 0.00000536 * $ T ** 2 + 0.000000002 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
84- $ a = 0.387098310 ;
85- $ e = 0.20563175 + 0.000020407 * $ T - 0.0000000283 * $ T ** 2 - 0.00000000018 * $ T ** 3 ;
86- $ i = (new Coordinate (7.004986 - 0.0059516 * $ T + 0.00000080 * $ T ** 2 + 0.000000043 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
83+ $ L = (new Coordinate (252.250906 + 149472.6746358 * $ T - 0.00000536 * $ T ** 2 + 0.000000002 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
84+ $ a = 0.387098310 ;
85+ $ e = 0.20563175 + 0.000020407 * $ T - 0.0000000283 * $ T ** 2 - 0.00000000018 * $ T ** 3 ;
86+ $ i = (new Coordinate (7.004986 - 0.0059516 * $ T + 0.00000080 * $ T ** 2 + 0.000000043 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
8787 $ omega = (new Coordinate (48.330893 - 0.1254227 * $ T - 0.00008833 * $ T ** 2 - 0.000000200 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
88- $ pi = (new Coordinate (77.456119 + 0.1588643 * $ T - 0.00001342 * $ T ** 2 - 0.000000007 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
89- $ M = $ L - $ pi ;
88+ $ pi = (new Coordinate (77.456119 + 0.1588643 * $ T - 0.00001342 * $ T ** 2 - 0.000000007 * $ T ** 3 , 0 , 360 ))->getCoordinate ();
89+ $ M = $ L - $ pi ;
9090
9191 return [$ L , $ a , $ e , $ i , $ omega , $ pi , $ M ];
9292 }
@@ -296,17 +296,17 @@ public function calculateHeliocentricCoordinates(Carbon $date): array
296296 */
297297 public function inferior_conjunction (Carbon $ date ): Carbon
298298 {
299- $ A = 2451612.023 ;
300- $ B = 115.8774771 ;
299+ $ A = 2451612.023 ;
300+ $ B = 115.8774771 ;
301301 $ M0 = 63.5867 ;
302302 $ M1 = 114.2088742 ;
303303
304304 $ Y = $ date ->year + $ date ->dayOfYear / (365 + $ date ->format ('L ' ));
305305
306- $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
306+ $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
307307 $ JDE0 = $ A + $ k * $ B ;
308- $ M = deg2rad ($ M0 + $ k * $ M1 );
309- $ T = ($ JDE0 - 2451545 ) / 36525 ;
308+ $ M = deg2rad ($ M0 + $ k * $ M1 );
309+ $ T = ($ JDE0 - 2451545 ) / 36525 ;
310310
311311 $ diff = 0.0545 + 0.0002 * $ T
312312 + sin ($ M ) * (-6.2008 + 0.0074 * $ T + 0.00003 * $ T * $ T )
@@ -336,17 +336,17 @@ public function inferior_conjunction(Carbon $date): Carbon
336336 */
337337 public function superior_conjunction (Carbon $ date ): Carbon
338338 {
339- $ A = 2451554.084 ;
340- $ B = 115.8774771 ;
339+ $ A = 2451554.084 ;
340+ $ B = 115.8774771 ;
341341 $ M0 = 6.4822 ;
342342 $ M1 = 114.2088742 ;
343343
344344 $ Y = $ date ->year + $ date ->dayOfYear / (365 + $ date ->format ('L ' ));
345345
346- $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
346+ $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
347347 $ JDE0 = $ A + $ k * $ B ;
348- $ M = deg2rad ($ M0 + $ k * $ M1 );
349- $ T = ($ JDE0 - 2451545 ) / 36525 ;
348+ $ M = deg2rad ($ M0 + $ k * $ M1 );
349+ $ T = ($ JDE0 - 2451545 ) / 36525 ;
350350
351351 $ diff = -0.0545 - 0.0002 * $ T
352352 + sin ($ M ) * (7.3894 - 0.0100 * $ T - 0.00003 * $ T * $ T )
@@ -377,17 +377,17 @@ public function superior_conjunction(Carbon $date): Carbon
377377 */
378378 public function greatest_eastern_elongation (Carbon $ date ): Carbon
379379 {
380- $ A = 2451612.023 ;
381- $ B = 115.8774771 ;
380+ $ A = 2451612.023 ;
381+ $ B = 115.8774771 ;
382382 $ M0 = 63.5867 ;
383383 $ M1 = 114.2088742 ;
384384
385385 $ Y = $ date ->year + $ date ->dayOfYear / (365 + $ date ->format ('L ' ));
386386
387- $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
387+ $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
388388 $ JDE0 = $ A + $ k * $ B ;
389- $ M = deg2rad ($ M0 + $ k * $ M1 );
390- $ T = ($ JDE0 - 2451545 ) / 36525 ;
389+ $ M = deg2rad ($ M0 + $ k * $ M1 );
390+ $ T = ($ JDE0 - 2451545 ) / 36525 ;
391391
392392 $ diff = -21.6101 + 0.0002 * $ T
393393 + sin ($ M ) * (-1.9803 - 0.0060 * $ T + 0.00001 * $ T * $ T )
@@ -418,17 +418,17 @@ public function greatest_eastern_elongation(Carbon $date): Carbon
418418 */
419419 public function greatest_western_elongation (Carbon $ date ): Carbon
420420 {
421- $ A = 2451612.023 ;
422- $ B = 115.8774771 ;
421+ $ A = 2451612.023 ;
422+ $ B = 115.8774771 ;
423423 $ M0 = 63.5867 ;
424424 $ M1 = 114.2088742 ;
425425
426426 $ Y = $ date ->year + $ date ->dayOfYear / (365 + $ date ->format ('L ' ));
427427
428- $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
428+ $ k = ceil ((365.2425 * $ Y + 1721060 - $ A ) / ($ B ));
429429 $ JDE0 = $ A + $ k * $ B ;
430- $ M = deg2rad ($ M0 + $ k * $ M1 );
431- $ T = ($ JDE0 - 2451545 ) / 36525 ;
430+ $ M = deg2rad ($ M0 + $ k * $ M1 );
431+ $ T = ($ JDE0 - 2451545 ) / 36525 ;
432432
433433 $ diff = 21.6249 - 0.0002 * $ T
434434 + sin ($ M ) * (0.1306 + 0.0065 * $ T )
@@ -482,7 +482,7 @@ public function aphelionDate(Carbon $date): Carbon
482482 $ Y = $ date ->year + $ date ->dayOfYear / (365 + $ date ->format ('L ' ));
483483
484484 // $k is integer increased by 0.5
485- $ k = round (4.15201 * ($ Y - 2000.12 )) + 0.5 ;
485+ $ k = round (4.15201 * ($ Y - 2000.12 )) + 0.5 ;
486486 $ JDE = 2451590.257 + 87.96934963 * $ k - 0.0000000000 * $ k * $ k ;
487487
488488 return Time::fromJd ($ JDE );
@@ -500,11 +500,11 @@ public function aphelionDate(Carbon $date): Carbon
500500 public function magnitude (Carbon $ date ): float
501501 {
502502 $ helio_coords = $ this ->calculateHeliocentricCoordinates ($ date );
503- $ R = $ helio_coords [2 ];
503+ $ R = $ helio_coords [2 ];
504504
505- $ earth = new Earth ();
505+ $ earth = new Earth ();
506506 $ helio_coords_earth = $ earth ->calculateHeliocentricCoordinates ($ date );
507- $ R0 = $ helio_coords_earth [2 ];
507+ $ R0 = $ helio_coords_earth [2 ];
508508
509509 $ x = $ helio_coords [2 ] * cos (deg2rad ($ helio_coords [1 ])) * cos (deg2rad ($ helio_coords [0 ])) -
510510 $ helio_coords_earth [2 ] * cos (deg2rad ($ helio_coords_earth [1 ])) * cos (deg2rad ($ helio_coords_earth [0 ]));
@@ -533,9 +533,9 @@ public function calculateDiameter(Carbon $date)
533533 {
534534 $ helio_coords = $ this ->calculateHeliocentricCoordinates ($ date );
535535
536- $ earth = new Earth ();
536+ $ earth = new Earth ();
537537 $ helio_coords_earth = $ earth ->calculateHeliocentricCoordinates ($ date );
538- $ x = $ helio_coords [2 ] * cos (deg2rad ($ helio_coords [1 ])) * cos (deg2rad ($ helio_coords [0 ])) -
538+ $ x = $ helio_coords [2 ] * cos (deg2rad ($ helio_coords [1 ])) * cos (deg2rad ($ helio_coords [0 ])) -
539539 $ helio_coords_earth [2 ] * cos (deg2rad ($ helio_coords_earth [1 ])) * cos (deg2rad ($ helio_coords_earth [0 ]));
540540 $ y = $ helio_coords [2 ] * cos (deg2rad ($ helio_coords [1 ])) * sin (deg2rad ($ helio_coords [0 ])) -
541541 $ helio_coords_earth [2 ] * cos (deg2rad ($ helio_coords_earth [1 ])) * sin (deg2rad ($ helio_coords_earth [0 ]));
0 commit comments