« lib/Astro/Montenbruck/Ephemeris/Planet/Mercury.pm
↑ Summary
lib/Astro/Montenbruck/Ephemeris/Planet/Saturn.pm »
| 1 | package Astro::Montenbruck::Ephemeris::Planet::Neptune; | ||
| 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 base qw/Astro::Montenbruck::Ephemeris::Planet/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use Math::Trig qw/:pi/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 2 | ▶ | use Astro::Montenbruck::Ephemeris::Pert qw/pert/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use Astro::Montenbruck::MathUtils qw /frac ARCS/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use Astro::Montenbruck::Ephemeris::Planet qw/$NE/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 2 | our $VERSION = 0.02; | |
| 13 | |||
| 14 | 4 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 15 | 4 | my $class = shift; | |
| 16 | 4 | $class->SUPER::new( id => $NE ); | |
| 17 | } | ||
| 18 | |||
| 19 | 4 | ▶ | sub heliocentric { |
|
Subroutine
heliocentric: called CC=1 SCAR=0.0
Pod
documented
| |||
| 20 | 4 | my ( $self, $t ) = @_; | |
| 21 | |||
| 22 | # Mean anomalies of planets in [rad] | ||
| 23 | 4 | my $m5 = pi2 * frac( 0.0563867 + 8.4298907 * $t ); | |
| 24 | 4 | my $m6 = pi2 * frac( 0.8825086 + 3.3957748 * $t ); | |
| 25 | 4 | my $m7 = pi2 * frac( 0.3965358 + 1.1902851 * $t ); | |
| 26 | 4 | my $m8 = pi2 * frac( 0.7214906 + 0.6068526 * $t ); | |
| 27 | |||
| 28 | 4 | my ( $dl, $dr, $db ) = ( 0, 0, 0 ); # Corrections in longitude ["], | |
| 29 | 140 | ▶ | my $pert_cb = sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 30 | 140 | $dl += $_[0]; | |
| 31 | 140 | $dr += $_[1]; | |
| 32 | 140 | $db += $_[2] | |
| 33 | 4 | }; | |
| 34 | |||
| 35 | # Perturbations by Jupiter | ||
| 36 | 4 | my $term = pert( | |
| 37 | T => $t, | ||
| 38 | M => $m8, | ||
| 39 | m => $m5, | ||
| 40 | I_min => 0, | ||
| 41 | I_max => 2, | ||
| 42 | i_min => -2, | ||
| 43 | i_max => 0, | ||
| 44 | callback => $pert_cb | ||
| 45 | ); | ||
| 46 | |||
| 47 | 4 | $term->( 0, -1, 0, 0.1, 0.1, -3.0, 1.8, -0.3, -0.3 ); | |
| 48 | 4 | $term->( 1, 0, 0, 0.0, 0.0, -15.9, 9.0, 0.0, 0.0 ); | |
| 49 | 4 | $term->( 1, -1, 0, -17.6, -29.3, 416.1, -250.0, 0.0, 0.0 ); | |
| 50 | 4 | $term->( 1, -2, 0, -0.4, -0.7, 10.4, -6.2, 0.0, 0.0 ); | |
| 51 | 4 | $term->( 2, -1, 0, -0.2, -0.4, 2.4, -1.4, 0.4, -0.3 ); | |
| 52 | |||
| 53 | # Perturbations by Saturn | ||
| 54 | 4 | $term = pert( | |
| 55 | T => $t, | ||
| 56 | M => $m8, | ||
| 57 | m => $m6, | ||
| 58 | I_min => 0, | ||
| 59 | I_max => 2, | ||
| 60 | i_min => -2, | ||
| 61 | i_max => 0, | ||
| 62 | callback => $pert_cb | ||
| 63 | ); | ||
| 64 | |||
| 65 | 4 | $term->( 0, -1, 0, -0.1, 0.0, 0.2, -1.8, -0.1, -0.5 ); | |
| 66 | 4 | $term->( 1, 0, 0, 0.0, 0.0, -8.3, -10.4, 0.0, 0.0 ); | |
| 67 | 4 | $term->( 1, -1, 0, 13.6, -12.7, 187.5, 201.1, 0.0, 0.0 ); | |
| 68 | 4 | $term->( 1, -2, 0, 0.4, -0.4, 4.5, 4.5, 0.0, 0.0 ); | |
| 69 | 4 | $term->( 2, -1, 0, 0.4, -0.1, 1.7, -3.2, 0.2, 0.2 ); | |
| 70 | 4 | $term->( 2, -2, 0, -0.1, 0.0, -0.2, 2.7, 0.0, 0.0 ); | |
| 71 | |||
| 72 | # Perturbations by Uranus | ||
| 73 | 4 | $term = pert( | |
| 74 | T => $t, | ||
| 75 | M => $m8, | ||
| 76 | m => $m7, | ||
| 77 | I_min => 1, | ||
| 78 | I_max => 6, | ||
| 79 | i_min => -6, | ||
| 80 | i_max => 0, | ||
| 81 | callback => $pert_cb | ||
| 82 | ); | ||
| 83 | 4 | $term->( 1, 0, 0, 32.3, 3549.5, -25880.2, 235.8, -6360.5, 374.0 ); | |
| 84 | 4 | $term->( 1, 0, 1, 31.2, 34.4, -251.4, 227.4, 34.9, 29.3 ); | |
| 85 | 4 | $term->( 1, 0, 2, -1.4, 3.9, -28.6, -10.1, 0.0, -0.9 ); | |
| 86 | 4 | $term->( 2, 0, 0, 6.1, 68.0, -111.4, 2.0, -54.7, 3.7 ); | |
| 87 | 4 | $term->( 2, 0, 1, 0.8, -0.2, -2.1, 2.0, -0.2, 0.8 ); | |
| 88 | 4 | $term->( 3, 0, 0, 0.1, 1.0, -0.7, 0.0, -0.8, 0.1 ); | |
| 89 | 4 | $term->( 0, -1, 0, -0.1, -0.3, -3.6, 0.0, 0.0, 0.0 ); | |
| 90 | 4 | $term->( 1, 0, 0, 0.0, 0.0, 5.5, -6.9, 0.1, 0.0 ); | |
| 91 | 4 | $term->( 1, -1, 0, -2.2, -1.6, -116.3, 163.6, 0.0, -0.1 ); | |
| 92 | 4 | $term->( 1, -2, 0, 0.2, 0.1, -1.2, 0.4, 0.0, -0.1 ); | |
| 93 | 4 | $term->( 2, -1, 0, 4.2, -1.1, -4.4, -34.6, -0.2, 0.1 ); | |
| 94 | 4 | $term->( 2, -2, 0, 8.6, -2.9, -33.4, -97.0, 0.2, 0.1 ); | |
| 95 | 4 | $term->( 3, -1, 0, 0.1, -0.2, 2.1, -1.2, 0.0, 0.1 ); | |
| 96 | 4 | $term->( 3, -2, 0, -4.6, 9.3, 38.2, 19.8, 0.1, 0.1 ); | |
| 97 | 4 | $term->( 3, -3, 0, -0.5, 1.7, 23.5, 7.0, 0.0, 0.0 ); | |
| 98 | 4 | $term->( 4, -2, 0, 0.2, 0.8, 3.3, -1.5, -0.2, -0.1 ); | |
| 99 | 4 | $term->( 4, -3, 0, 0.9, 1.7, 17.9, -9.1, -0.1, 0.0 ); | |
| 100 | 4 | $term->( 4, -4, 0, -0.4, -0.4, -6.2, 4.8, 0.0, 0.0 ); | |
| 101 | 4 | $term->( 5, -3, 0, -1.6, -0.5, -2.2, 7.0, 0.0, 0.0 ); | |
| 102 | 4 | $term->( 5, -4, 0, -0.4, -0.1, -0.7, 5.5, 0.0, 0.0 ); | |
| 103 | 4 | $term->( 5, -5, 0, 0.2, 0.0, 0.0, -3.5, 0.0, 0.0 ); | |
| 104 | 4 | $term->( 6, -4, 0, -0.3, 0.2, 2.1, 2.7, 0.0, 0.0 ); | |
| 105 | 4 | $term->( 6, -5, 0, 0.1, -0.1, -1.4, -1.4, 0.0, 0.0 ); | |
| 106 | 4 | $term->( 6, -6, 0, -0.1, 0.1, 1.4, 0.7, 0.0, 0.0 ); | |
| 107 | |||
| 108 | # Ecliptic coordinates ([rad],[AU]) | ||
| 109 | 4 | my $l = | |
| 110 | pi2 * | ||
| 111 | frac( 0.1254046 + $m8 / pi2 + | ||
| 112 | ( ( 4982.8 - 21.3 * $t ) * $t + $dl ) / 1296.0e3 ); | ||
| 113 | 4 | my $r = 30.072984 + ( 0.001234 + 0.000003 * $t ) * $t + $dr * 1.0e-5; | |
| 114 | 4 | my $b = ( 54.77 + ( 0.26 + 0.06 * $t ) * $t + $db ) / ARCS; | |
| 115 | |||
| 116 | 4 | $l, $b, $r; | |
| 117 | |||
| 118 | } | ||
| 119 | |||
| 120 | # Intermediate variables for calculating geocentric positions. | ||
| 121 | 4 | ▶ | sub _lbr_geo { |
|
Subroutine
_lbr_geo: called CC=1 SCAR=0.0
| |||
| 122 | 4 | my ( $self, $t ) = @_; | |
| 123 | |||
| 124 | 4 | my $m = pi2 * frac( 0.7214906 + 0.6068526 * $t ); | |
| 125 | 4 | my $dl = 1.04 + 0.02 * cos($m); | |
| 126 | 4 | my $dr = 0.27 * sin($m); | |
| 127 | 4 | my $db = 0.03 * sin($m); | |
| 128 | |||
| 129 | 4 | $dl, $db, $dr; | |
| 130 | } | ||
| 131 | |||
| 132 | 2 | 1; | |
| 133 | |||
| 134 | __END__ | ||