Skip to content

Commit 573182f

Browse files
WimDeMeesterStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 20f2611 commit 573182f

10 files changed

Lines changed: 405 additions & 405 deletions

File tree

src/deepskylog/AstronomyLibrary/Targets/Jupiter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3784,9 +3784,9 @@ public function calculateDiameter(Carbon $date)
37843784
{
37853785
$helio_coords = $this->calculateHeliocentricCoordinates($date);
37863786

3787-
$earth = new Earth();
3787+
$earth = new Earth();
37883788
$helio_coords_earth = $earth->calculateHeliocentricCoordinates($date);
3789-
$x = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * cos(deg2rad($helio_coords[0])) -
3789+
$x = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * cos(deg2rad($helio_coords[0])) -
37903790
$helio_coords_earth[2] * cos(deg2rad($helio_coords_earth[1])) * cos(deg2rad($helio_coords_earth[0]));
37913791
$y = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * sin(deg2rad($helio_coords[0])) -
37923792
$helio_coords_earth[2] * cos(deg2rad($helio_coords_earth[1])) * sin(deg2rad($helio_coords_earth[0]));

src/deepskylog/AstronomyLibrary/Targets/Mars.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
namespace deepskylog\AstronomyLibrary\Targets;
1515

1616
use Carbon\Carbon;
17-
use deepskylog\AstronomyLibrary\Time;
1817
use deepskylog\AstronomyLibrary\Coordinates\Coordinate;
18+
use deepskylog\AstronomyLibrary\Time;
1919

2020
/**
2121
* The target class describing Mars.
@@ -47,15 +47,15 @@ class Mars 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(355.433000 + 19141.6964471 * $T + 0.00031052 * $T ** 2 + 0.000000016 * $T ** 3, 0, 360))->getCoordinate();
53-
$a = 1.523679342;
54-
$e = 0.09340065 + 0.000090484 * $T - 0.0000000806 * $T ** 2 - 0.00000000025 * $T ** 3;
55-
$i = (new Coordinate(1.849726 - 0.0006011 * $T + 0.00001276 * $T ** 2 - 0.000000007 * $T ** 3, 0, 360))->getCoordinate();
52+
$L = (new Coordinate(355.433000 + 19141.6964471 * $T + 0.00031052 * $T ** 2 + 0.000000016 * $T ** 3, 0, 360))->getCoordinate();
53+
$a = 1.523679342;
54+
$e = 0.09340065 + 0.000090484 * $T - 0.0000000806 * $T ** 2 - 0.00000000025 * $T ** 3;
55+
$i = (new Coordinate(1.849726 - 0.0006011 * $T + 0.00001276 * $T ** 2 - 0.000000007 * $T ** 3, 0, 360))->getCoordinate();
5656
$omega = (new Coordinate(49.558093 + 0.7720959 * $T + 0.00001557 * $T ** 2 + 0.000002267 * $T ** 3, 0, 360))->getCoordinate();
57-
$pi = (new Coordinate(336.060234 + 1.8410449 * $T - 0.00013477 * $T ** 2 + 0.000000536 * $T ** 3, 0, 360))->getCoordinate();
58-
$M = $L - $pi;
57+
$pi = (new Coordinate(336.060234 + 1.8410449 * $T - 0.00013477 * $T ** 2 + 0.000000536 * $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(355.433000 + 19140.2993039 * $T + 0.00000262 * $T ** 2 - 0.000000003 * $T ** 3, 0, 360))->getCoordinate();
84-
$a = 1.523679342;
85-
$e = 0.09340065 + 0.000090484 * $T - 0.0000000806 * $T ** 2 - 0.00000000025 * $T ** 3;
86-
$i = (new Coordinate(1.849726 - 0.0081477 * $T - 0.00002255 * $T ** 2 - 0.000000029 * $T ** 3, 0, 360))->getCoordinate();
83+
$L = (new Coordinate(355.433000 + 19140.2993039 * $T + 0.00000262 * $T ** 2 - 0.000000003 * $T ** 3, 0, 360))->getCoordinate();
84+
$a = 1.523679342;
85+
$e = 0.09340065 + 0.000090484 * $T - 0.0000000806 * $T ** 2 - 0.00000000025 * $T ** 3;
86+
$i = (new Coordinate(1.849726 - 0.0081477 * $T - 0.00002255 * $T ** 2 - 0.000000029 * $T ** 3, 0, 360))->getCoordinate();
8787
$omega = (new Coordinate(49.558093 - 0.2950250 * $T - 0.00064048 * $T ** 2 - 0.000001964 * $T ** 3, 0, 360))->getCoordinate();
88-
$pi = (new Coordinate(336.060234 + 0.4439016 * $T - 0.00017313 * $T ** 2 + 0.000000518 * $T ** 3, 0, 360))->getCoordinate();
89-
$M = $L - $pi;
88+
$pi = (new Coordinate(336.060234 + 0.4439016 * $T - 0.00017313 * $T ** 2 + 0.000000518 * $T ** 3, 0, 360))->getCoordinate();
89+
$M = $L - $pi;
9090

9191
return [$L, $a, $e, $i, $omega, $pi, $M];
9292
}
@@ -5628,17 +5628,17 @@ public function calculateHeliocentricCoordinates(Carbon $date): array
56285628
*/
56295629
public function opposition(Carbon $date): Carbon
56305630
{
5631-
$A = 2452097.382;
5632-
$B = 779.936104;
5631+
$A = 2452097.382;
5632+
$B = 779.936104;
56335633
$M0 = 181.9573;
56345634
$M1 = 48.705244;
56355635

56365636
$Y = $date->year + $date->dayOfYear / (365 + $date->format('L'));
56375637

5638-
$k = ceil((365.2425 * $Y + 1721060 - $A) / ($B));
5638+
$k = ceil((365.2425 * $Y + 1721060 - $A) / ($B));
56395639
$JDE0 = $A + $k * $B;
5640-
$M = deg2rad($M0 + $k * $M1);
5641-
$T = ($JDE0 - 2451545) / 36525;
5640+
$M = deg2rad($M0 + $k * $M1);
5641+
$T = ($JDE0 - 2451545) / 36525;
56425642

56435643
$diff = -0.3088 + 0.0000 * $T + 0.00002 * $T * $T
56445644
+ (-17.6965 + 0.0363 * $T + 0.00005 * $T * $T) * sin($M)
@@ -5668,17 +5668,17 @@ public function opposition(Carbon $date): Carbon
56685668
*/
56695669
public function conjunction(Carbon $date): Carbon
56705670
{
5671-
$A = 2451707.414;
5672-
$B = 779.936104;
5671+
$A = 2451707.414;
5672+
$B = 779.936104;
56735673
$M0 = 157.6047;
56745674
$M1 = 48.705244;
56755675

56765676
$Y = $date->year + $date->dayOfYear / (365 + $date->format('L'));
56775677

5678-
$k = ceil((365.2425 * $Y + 1721060 - $A) / ($B));
5678+
$k = ceil((365.2425 * $Y + 1721060 - $A) / ($B));
56795679
$JDE0 = $A + $k * $B;
5680-
$M = deg2rad($M0 + $k * $M1);
5681-
$T = ($JDE0 - 2451545) / 36525;
5680+
$M = deg2rad($M0 + $k * $M1);
5681+
$T = ($JDE0 - 2451545) / 36525;
56825682

56835683
$diff = 0.3102 - 0.0001 * $T + 0.00001 * $T * $T
56845684
+ (9.7273 - 0.0156 * $T + 0.00001 * $T * $T) * sin($M)
@@ -5751,11 +5751,11 @@ public function aphelionDate(Carbon $date): Carbon
57515751
public function magnitude(Carbon $date): float
57525752
{
57535753
$helio_coords = $this->calculateHeliocentricCoordinates($date);
5754-
$R = $helio_coords[2];
5754+
$R = $helio_coords[2];
57555755

5756-
$earth = new Earth();
5756+
$earth = new Earth();
57575757
$helio_coords_earth = $earth->calculateHeliocentricCoordinates($date);
5758-
$R0 = $helio_coords_earth[2];
5758+
$R0 = $helio_coords_earth[2];
57595759

57605760
$x = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * cos(deg2rad($helio_coords[0])) -
57615761
$helio_coords_earth[2] * cos(deg2rad($helio_coords_earth[1])) * cos(deg2rad($helio_coords_earth[0]));
@@ -5784,9 +5784,9 @@ public function calculateDiameter(Carbon $date)
57845784
{
57855785
$helio_coords = $this->calculateHeliocentricCoordinates($date);
57865786

5787-
$earth = new Earth();
5787+
$earth = new Earth();
57885788
$helio_coords_earth = $earth->calculateHeliocentricCoordinates($date);
5789-
$x = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * cos(deg2rad($helio_coords[0])) -
5789+
$x = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * cos(deg2rad($helio_coords[0])) -
57905790
$helio_coords_earth[2] * cos(deg2rad($helio_coords_earth[1])) * cos(deg2rad($helio_coords_earth[0]));
57915791
$y = $helio_coords[2] * cos(deg2rad($helio_coords[1])) * sin(deg2rad($helio_coords[0])) -
57925792
$helio_coords_earth[2] * cos(deg2rad($helio_coords_earth[1])) * sin(deg2rad($helio_coords_earth[0]));

src/deepskylog/AstronomyLibrary/Targets/Mercury.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
namespace deepskylog\AstronomyLibrary\Targets;
1515

1616
use Carbon\Carbon;
17-
use deepskylog\AstronomyLibrary\Time;
1817
use 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

Comments
 (0)