« lib/Astro/Montenbruck/Ephemeris/Planet/Mars.pm
↑ Summary
lib/Astro/Montenbruck/Ephemeris/Planet/Neptune.pm »
| 1 | package Astro::Montenbruck::Ephemeris::Planet::Mercury; | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 2 | ▶ | use Math::Trig qw/:pi/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use base qw/Astro::Montenbruck::Ephemeris::Planet/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use Astro::Montenbruck::Ephemeris::Pert qw /pert/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use Astro::Montenbruck::MathUtils qw /frac ARCS/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 2 | ▶ | use Astro::Montenbruck::Ephemeris::Planet qw/$ME/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 2 | our $VERSION = 0.01; | |
| 14 | |||
| 15 | 4 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 16 | 4 | my $class = shift; | |
| 17 | 4 | $class->SUPER::new( id => $ME ); | |
| 18 | } | ||
| 19 | |||
| 20 | 4 | ▶ | sub heliocentric { |
|
Subroutine
heliocentric: called CC=1 SCAR=0.0
Pod
documented
| |||
| 21 | 4 | my ( $self, $t ) = @_; | |
| 22 | |||
| 23 | # Mean anomalies of planets in [rad] | ||
| 24 | 4 | my $m1 = pi2 * frac( 0.4855407 + 415.2014314 * $t ); | |
| 25 | 4 | my $m2 = pi2 * frac( 0.1394222 + 162.5490444 * $t ); | |
| 26 | 4 | my $m3 = pi2 * frac( 0.9937861 + 99.9978139 * $t ); | |
| 27 | 4 | my $m5 = pi2 * frac( 0.0558417 + 8.4298417 * $t ); | |
| 28 | 4 | my $m6 = pi2 * frac( 0.8823333 + 3.3943333 * $t ); | |
| 29 | |||
| 30 | 4 | my ( $dl, $dr, $db ) = ( 0, 0, 0 ); # Corrections in longitude ["], | |
| 31 | 4 | ▶ | my $pert_cb = sub { $dl += $_[0]; $dr += $_[1]; $db += $_[2] }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 32 | |||
| 33 | # Keplerian motion and perturbations by Venus | ||
| 34 | 4 | my $term = pert( | |
| 35 | T => $t, | ||
| 36 | M => $m1, | ||
| 37 | m => $m2, | ||
| 38 | I_min => -1, | ||
| 39 | I_max => 9, | ||
| 40 | i_min => -5, | ||
| 41 | i_max => 0, | ||
| 42 | callback => $pert_cb | ||
| 43 | ); | ||
| 44 | |||
| 45 | 4 | $term->( 1, 0, 0, 259.74, 84547.39, -78342.34, 0.01, 11683.22, 21203.79 ); | |
| 46 | 4 | $term->( 1, 0, 1, 2.30, 5.04, -7.52, 0.02, 138.55, -71.01 ); | |
| 47 | 4 | $term->( 1, 0, 2, 0.01, -0.01, 0.01, 0.01, -0.19, -0.54 ); | |
| 48 | 4 | $term->( 2, 0, 0, -549.71, 10394.44, -7955.45, 0.00, 2390.29, 4306.79 ); | |
| 49 | 4 | $term->( 2, 0, 1, -4.77, 8.97, -1.53, 0.00, 28.49, -14.18 ); | |
| 50 | 4 | $term->( 2, 0, 2, 0.00, 0.00, 0.00, 0.00, -0.04, -0.11 ); | |
| 51 | 4 | $term->( 3, 0, 0, -234.04, 1748.74, -1212.86, 0.00, 535.41, 984.33 ); | |
| 52 | 4 | $term->( 3, 0, 1, -2.03, 3.48, -0.35, 0.00, 6.56, -2.91 ); | |
| 53 | 4 | $term->( 4, 0, 0, -77.64, 332.63, -219.23, 0.00, 124.40, 237.03 ); | |
| 54 | 4 | $term->( 4, 0, 1, -0.70, 1.10, -0.08, 0.00, 1.59, -0.59 ); | |
| 55 | 4 | $term->( 5, 0, 0, -23.59, 67.28, -43.54, 0.00, 29.44, 58.77 ); | |
| 56 | 4 | $term->( 5, 0, 1, -0.23, 0.32, -0.02, 0.00, 0.39, -0.11 ); | |
| 57 | 4 | $term->( 6, 0, 0, -6.86, 14.06, -9.18, 0.00, 7.03, 14.84 ); | |
| 58 | 4 | $term->( 6, 0, 1, -0.07, 0.09, -0.01, 0.00, 0.10, -0.02 ); | |
| 59 | 4 | $term->( 7, 0, 0, -1.94, 2.98, -2.02, 0.00, 1.69, 3.80 ); | |
| 60 | 4 | $term->( 8, 0, 0, -0.54, 0.63, -0.46, 0.00, 0.41, 0.98 ); | |
| 61 | 4 | $term->( 9, 0, 0, -0.15, 0.13, -0.11, 0.00, 0.10, 0.25 ); | |
| 62 | 4 | $term->( -1, -2, 0, -0.17, -0.06, -0.05, 0.14, -0.06, -0.07 ); | |
| 63 | 4 | $term->( 0, -1, 0, 0.24, -0.16, -0.11, -0.16, 0.04, -0.01 ); | |
| 64 | 4 | $term->( 0, -2, 0, -0.68, -0.25, -0.26, 0.73, -0.16, -0.18 ); | |
| 65 | 4 | $term->( 0, -5, 0, 0.37, 0.08, 0.06, -0.28, 0.13, 0.12 ); | |
| 66 | 4 | $term->( 1, -1, 0, 0.58, -0.41, 0.26, 0.36, 0.01, -0.01 ); | |
| 67 | 4 | $term->( 1, -2, 0, -3.51, -1.23, 0.23, -0.63, -0.05, -0.06 ); | |
| 68 | 4 | $term->( 1, -3, 0, 0.08, 0.53, -0.11, 0.04, 0.02, -0.09 ); | |
| 69 | 4 | $term->( 1, -5, 0, 1.44, 0.31, 0.30, -1.39, 0.34, 0.29 ); | |
| 70 | 4 | $term->( 2, -1, 0, 0.15, -0.11, 0.09, 0.12, 0.02, -0.04 ); | |
| 71 | 4 | $term->( 2, -2, 0, -1.99, -0.68, 0.65, -1.91, -0.20, 0.03 ); | |
| 72 | 4 | $term->( 2, -3, 0, -0.34, -1.28, 0.97, -0.26, 0.03, 0.03 ); | |
| 73 | 4 | $term->( 2, -4, 0, -0.33, 0.35, -0.13, -0.13, -0.01, 0.00 ); | |
| 74 | 4 | $term->( 2, -5, 0, 7.19, 1.56, -0.05, 0.12, 0.06, 0.05 ); | |
| 75 | 4 | $term->( 3, -2, 0, -0.52, -0.18, 0.13, -0.39, -0.16, 0.03 ); | |
| 76 | 4 | $term->( 3, -3, 0, -0.11, -0.42, 0.36, -0.10, -0.05, -0.05 ); | |
| 77 | 4 | $term->( 3, -4, 0, -0.19, 0.22, -0.23, -0.20, -0.01, 0.02 ); | |
| 78 | 4 | $term->( 3, -5, 0, 2.77, 0.49, -0.45, 2.56, 0.40, -0.12 ); | |
| 79 | 4 | $term->( 4, -5, 0, 0.67, 0.12, -0.09, 0.47, 0.24, -0.08 ); | |
| 80 | 4 | $term->( 5, -5, 0, 0.18, 0.03, -0.02, 0.12, 0.09, -0.03 ); | |
| 81 | |||
| 82 | # Perturbations by the Earth | ||
| 83 | 4 | $term = pert( | |
| 84 | T => $t, | ||
| 85 | M => $m1, | ||
| 86 | m => $m3, | ||
| 87 | I_min => 0, | ||
| 88 | I_max => 2, | ||
| 89 | i_min => -4, | ||
| 90 | i_max => -1, | ||
| 91 | callback => $pert_cb | ||
| 92 | ); | ||
| 93 | |||
| 94 | 4 | $term->( 0, -4, 0, -0.11, -0.07, -0.08, 0.11, -0.02, -0.04 ); | |
| 95 | 4 | $term->( 1, -1, 0, 0.10, -0.20, 0.15, 0.07, 0.00, 0.00 ); | |
| 96 | 4 | $term->( 1, -2, 0, -0.35, 0.28, -0.13, -0.17, -0.01, 0.00 ); | |
| 97 | 4 | $term->( 1, -4, 0, -0.67, -0.45, 0.00, 0.01, -0.01, -0.01 ); | |
| 98 | 4 | $term->( 2, -2, 0, -0.20, 0.16, -0.16, -0.20, -0.01, 0.02 ); | |
| 99 | 4 | $term->( 2, -3, 0, 0.13, -0.02, 0.02, 0.14, 0.01, 0.00 ); | |
| 100 | 4 | $term->( 2, -4, 0, -0.33, -0.18, 0.17, -0.31, -0.04, 0.00 ); | |
| 101 | |||
| 102 | # Perturbations by Mercury | ||
| 103 | 4 | $term = pert( | |
| 104 | T => $t, | ||
| 105 | M => $m1, | ||
| 106 | m => $m5, | ||
| 107 | I_min => -1, | ||
| 108 | I_max => 3, | ||
| 109 | i_min => -3, | ||
| 110 | i_max => -1, | ||
| 111 | callback => $pert_cb | ||
| 112 | ); | ||
| 113 | |||
| 114 | 4 | $term->( -1, -1, 0, -0.08, 0.16, 0.15, 0.08, -0.04, 0.01 ); | |
| 115 | 4 | $term->( -1, -2, 0, 0.10, -0.06, -0.07, -0.12, 0.07, -0.01 ); | |
| 116 | 4 | $term->( 0, -1, 0, -0.31, 0.48, -0.02, 0.13, -0.03, -0.02 ); | |
| 117 | 4 | $term->( 0, -2, 0, 0.42, -0.26, -0.38, -0.50, 0.20, -0.03 ); | |
| 118 | 4 | $term->( 1, -1, 0, -0.70, 0.01, -0.02, -0.63, 0.00, 0.03 ); | |
| 119 | 4 | $term->( 1, -2, 0, 2.61, -1.97, 1.74, 2.32, 0.01, 0.01 ); | |
| 120 | 4 | $term->( 1, -3, 0, 0.32, -0.15, 0.13, 0.28, 0.00, 0.00 ); | |
| 121 | 4 | $term->( 2, -1, 0, -0.18, 0.01, 0.00, -0.13, -0.03, 0.03 ); | |
| 122 | 4 | $term->( 2, -2, 0, 0.75, -0.56, 0.45, 0.60, 0.08, -0.17 ); | |
| 123 | 4 | $term->( 3, -2, 0, 0.20, -0.15, 0.10, 0.14, 0.04, -0.08 ); | |
| 124 | |||
| 125 | # Perturbations by Saturn | ||
| 126 | 4 | $term = pert( | |
| 127 | T => $t, | ||
| 128 | M => $m1, | ||
| 129 | m => $m6, | ||
| 130 | I_min => 1, | ||
| 131 | I_max => 1, | ||
| 132 | i_min => -2, | ||
| 133 | i_max => -2, | ||
| 134 | callback => $pert_cb | ||
| 135 | ); | ||
| 136 | |||
| 137 | 4 | $term->( 1, -2, 0, -0.19, 0.33, 0.0, 0.0, 0.0, 0.0 ); | |
| 138 | 4 | $dl += 2.8 + 3.2 * $t; | |
| 139 | |||
| 140 | # Ecliptic coordinates ([rad],[AU]) | ||
| 141 | 4 | my $l = | |
| 142 | pi2 * | ||
| 143 | frac( 0.2151379 + $m1 / pi2 + | ||
| 144 | ( ( 5601.7 + 1.1 * $t ) * $t + $dl ) / 1296.0e3 ); | ||
| 145 | 4 | my $r = 0.3952829 + 0.0000016 * $t + $dr * 1.0e-6; | |
| 146 | 4 | my $b = ( -2522.15 + ( -30.18 + 0.04 * $t ) * $t + $db ) / ARCS; | |
| 147 | |||
| 148 | 4 | $l, $b, $r; | |
| 149 | } | ||
| 150 | |||
| 151 | # Intermediate variables for calculating geocentric positions. | ||
| 152 | 4 | ▶ | sub _lbr_geo { |
|
Subroutine
_lbr_geo: called CC=1 SCAR=0.0
| |||
| 153 | 4 | my ( $self, $t ) = @_; | |
| 154 | |||
| 155 | 4 | my $m = pi2 * frac( 0.4855407 + 415.2014314 * $t ); | |
| 156 | 4 | my $dl = | |
| 157 | 714.00 + 292.66 * cos($m) + | ||
| 158 | 71.96 * cos( 2 * $m ) + | ||
| 159 | 18.16 * cos( 3 * $m ) + | ||
| 160 | 4.61 * cos( 4 * $m ) + | ||
| 161 | 3.81 * sin( 2 * $m ) + | ||
| 162 | 2.43 * sin( 3 * $m ) + | ||
| 163 | 1.08 * sin( 4 * $m ); | ||
| 164 | |||
| 165 | 4 | my $dr = 55.94 * sin($m) + 11.36 * sin( 2 * $m ) + 2.60 * sin( 3 * $m ); | |
| 166 | |||
| 167 | 4 | my $db = | |
| 168 | 73.40 * cos($m) + | ||
| 169 | 29.82 * cos( 2 * $m ) + | ||
| 170 | 10.22 * cos( 3 * $m ) + | ||
| 171 | 3.28 * cos( 4 * $m ) - | ||
| 172 | 40.44 * sin($m) - | ||
| 173 | 16.55 * sin( 2 * $m ) - | ||
| 174 | 5.56 * sin( 3 * $m ) - | ||
| 175 | 1.72 * sin( 4 * $m ); | ||
| 176 | |||
| 177 | 4 | $dl, $db, $dr; | |
| 178 | } | ||
| 179 | |||
| 180 | 2 | 1; | |
| 181 | |||
| 182 | __END__ | ||