| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Astro::Montenbruck::Ephemeris::Planet::Pluto; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 598 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 33 |  | 
| 4 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 46 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 7 | use POSIX qw/atan/; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 11 |  | 
| 7 | 1 |  |  | 1 |  | 86 | use Math::Trig qw/:pi deg2rad/; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 144 |  | 
| 8 | 1 |  |  | 1 |  | 7 | use base qw/Astro::Montenbruck::Ephemeris::Planet/; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 109 |  | 
| 9 | 1 |  |  | 1 |  | 8 | use Astro::Montenbruck::Ephemeris::Planet qw/$PL/; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 90 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 1 |  |  | 1 |  | 8 | use Astro::Montenbruck::Ephemeris::Pert qw/pert/; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 48 |  | 
| 12 | 1 |  |  | 1 |  | 6 | use Astro::Montenbruck::MathUtils qw /frac ARCS/; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 985 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | our $VERSION = 0.01; | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub new { | 
| 17 | 4 |  |  | 4 | 1 | 12 | my $class = shift; | 
| 18 | 4 |  |  |  |  | 27 | $class->SUPER::new( id => $PL ); | 
| 19 |  |  |  |  |  |  | } | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | sub heliocentric { | 
| 23 | 4 |  |  | 4 | 1 | 11 | my ( $self, $t ) = @_; | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | # Mean anomalies of planets in [rad] | 
| 26 | 4 |  |  |  |  | 16 | my $m5 = pi2 * frac( 0.0565314 + 8.4302963 * $t ); | 
| 27 | 4 |  |  |  |  | 17 | my $m6 = pi2 * frac( 0.8829867 + 3.3947688 * $t ); | 
| 28 | 4 |  |  |  |  | 15 | my $m9 = pi2 * frac( 0.0385795 + 0.4026667 * $t ); | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 4 |  |  |  |  | 12 | my ( $dl, $dr, $db ) = ( 0, 0, 0 );    # Corrections in longitude ["], | 
| 31 | 4 |  |  | 104 |  | 22 | my $pert_cb = sub { $dl += $_[0]; $dr += $_[1]; $db += $_[2] }; | 
|  | 104 |  |  |  |  | 158 |  | 
|  | 104 |  |  |  |  | 143 |  | 
|  | 104 |  |  |  |  | 169 |  | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | # Perturbations by Pluto | 
| 34 | 4 |  |  |  |  | 17 | my $term = pert( | 
| 35 |  |  |  |  |  |  | T        => $t, | 
| 36 |  |  |  |  |  |  | M        => $m9, | 
| 37 |  |  |  |  |  |  | m        => $m5, | 
| 38 |  |  |  |  |  |  | I_min    => 0, | 
| 39 |  |  |  |  |  |  | I_max    => 6, | 
| 40 |  |  |  |  |  |  | i_min    => -2, | 
| 41 |  |  |  |  |  |  | i_max    => 1, | 
| 42 |  |  |  |  |  |  | callback => $pert_cb | 
| 43 |  |  |  |  |  |  | ); | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 4 |  |  |  |  | 21 | $term->( 1, 0, 0, 0.06, 100924.08, -960396.0, 15965.1, 51987.68, -24288.76 ); | 
| 46 | 4 |  |  |  |  | 16 | $term->( 2, 0, 0, 3274.74, 17835.12, -118252.2, 3632.4, 12687.49, -6049.72 ); | 
| 47 | 4 |  |  |  |  | 15 | $term->( 3, 0,  0, 1543.52, 4631.99, -21446.6, 1167.0, 3504.00, -1853.10 ); | 
| 48 | 4 |  |  |  |  | 16 | $term->( 4, 0,  0, 688.99,  1227.08, -4823.4,  213.5,  1048.19, -648.26 ); | 
| 49 | 4 |  |  |  |  | 16 | $term->( 5, 0,  0, 242.27,  415.93,  -1075.4,  140.6,  302.33,  -209.76 ); | 
| 50 | 4 |  |  |  |  | 14 | $term->( 6, 0,  0, 138.41,  110.91,  -308.8,   -55.3,  109.52,  -93.82 ); | 
| 51 | 4 |  |  |  |  | 14 | $term->( 3, -1, 0, -0.99,   5.06,    -25.6,    19.8,   1.26,    -1.96 ); | 
| 52 | 4 |  |  |  |  | 13 | $term->( 2, -1, 0, 7.15,    5.61,    -96.7,    57.2,   1.64,    -2.16 ); | 
| 53 | 4 |  |  |  |  | 15 | $term->( 1, -1, 0, 10.79,   23.13,   -390.4,   236.4,  -0.33,   0.86 ); | 
| 54 | 4 |  |  |  |  | 14 | $term->( 0, 1,  0, -0.23,   4.43,    102.8,    63.2,   3.15,    0.34 ); | 
| 55 | 4 |  |  |  |  | 13 | $term->( 1, 1,  0, -1.10,   -0.92,   11.8,     -2.3,   0.43,    0.14 ); | 
| 56 | 4 |  |  |  |  | 14 | $term->( 2, 1,  0, 0.62,    0.84,    2.3,      0.7,    0.05,    -0.04 ); | 
| 57 | 4 |  |  |  |  | 12 | $term->( 3, 1,  0, -0.38,   -0.45,   1.2,      -0.8,   0.04,    0.05 ); | 
| 58 | 4 |  |  |  |  | 14 | $term->( 4, 1,  0, 0.17,    0.25,    0.0,      0.2,    -0.01,   -0.01 ); | 
| 59 | 4 |  |  |  |  | 14 | $term->( 3, -2, 0, 0.06,    0.07,    -0.6,     0.3,    0.03,    -0.03 ); | 
| 60 | 4 |  |  |  |  | 16 | $term->( 2, -2, 0, 0.13,    0.20,    -2.2,     1.5,    0.03,    -0.07 ); | 
| 61 | 4 |  |  |  |  | 14 | $term->( 1, -2, 0, 0.32,    0.49,    -9.4,     5.7,    -0.01,   0.03 ); | 
| 62 | 4 |  |  |  |  | 16 | $term->( 0, -2, 0, -0.04,   -0.07,   2.6,      -1.5,   0.07,    -0.02 ); | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | # Perturbations by Saturn | 
| 65 | 4 |  |  |  |  | 12 | $term = pert( | 
| 66 |  |  |  |  |  |  | T        => $t, | 
| 67 |  |  |  |  |  |  | M        => $m9, | 
| 68 |  |  |  |  |  |  | m        => $m6, | 
| 69 |  |  |  |  |  |  | I_min    => 0, | 
| 70 |  |  |  |  |  |  | I_max    => 3, | 
| 71 |  |  |  |  |  |  | i_min    => -2, | 
| 72 |  |  |  |  |  |  | i_max    => 1, | 
| 73 |  |  |  |  |  |  | callback => $pert_cb | 
| 74 |  |  |  |  |  |  | ); | 
| 75 |  |  |  |  |  |  |  | 
| 76 | 4 |  |  |  |  | 18 | $term->( 1, -1, 0, -29.47, 75.97,  -106.4, -204.9, -40.71, -17.55 ); | 
| 77 | 4 |  |  |  |  | 17 | $term->( 0, 1,  0, -13.88, 18.20,  42.6,   -46.1,  1.13,   0.43 ); | 
| 78 | 4 |  |  |  |  | 16 | $term->( 1, 1,  0, 5.81,   -23.48, 15.0,   -6.8,   -7.48,  3.07 ); | 
| 79 | 4 |  |  |  |  | 14 | $term->( 2, 1,  0, -10.27, 14.16,  -7.9,   0.4,    2.43,   -0.09 ); | 
| 80 | 4 |  |  |  |  | 14 | $term->( 3, 1,  0, 6.86,   -10.66, 7.3,    -0.3,   -2.25,  0.69 ); | 
| 81 | 4 |  |  |  |  | 13 | $term->( 2, -2, 0, 4.32,   2.00,   0.0,    -2.2,   -0.24,  0.12 ); | 
| 82 | 4 |  |  |  |  | 15 | $term->( 1, -2, 0, -5.04,  -0.83,  -9.2,   -3.1,   0.79,   -0.24 ); | 
| 83 | 4 |  |  |  |  | 15 | $term->( 0, -2, 0, 4.25,   2.48,   -5.9,   -3.3,   0.58,   0.02 ); | 
| 84 |  |  |  |  |  |  |  | 
| 85 |  |  |  |  |  |  | # Perturbations by Pluto and Saturn | 
| 86 | 4 |  |  |  |  | 9 | my $phi = ( $m5 - $m6 ); | 
| 87 | 4 |  |  |  |  | 9 | my $c   = cos($phi); | 
| 88 | 4 |  |  |  |  | 10 | my $s   = sin($phi); | 
| 89 | 4 |  |  |  |  | 19 | $dl += -9.11 * $c + 0.12 * $s; | 
| 90 | 4 |  |  |  |  | 11 | $dr += -3.4 * $c - 3.3 * $s; | 
| 91 | 4 |  |  |  |  | 10 | $db += +0.81 * $c + 0.78 * $s; | 
| 92 |  |  |  |  |  |  |  | 
| 93 | 4 |  |  |  |  | 9 | $phi = ( $m5 - $m6 + $m9 ); | 
| 94 | 4 |  |  |  |  | 10 | $c   = cos($phi); | 
| 95 | 4 |  |  |  |  | 8 | $s   = sin($phi); | 
| 96 | 4 |  |  |  |  | 9 | $dl += +5.92 * $c + 0.25 * $s; | 
| 97 | 4 |  |  |  |  | 7 | $dr += +2.3 * $c - 3.8 * $s; | 
| 98 | 4 |  |  |  |  | 7 | $db += -0.67 * $c - 0.51 * $s; | 
| 99 |  |  |  |  |  |  |  | 
| 100 |  |  |  |  |  |  | # Ecliptic coordinates ([rad],[AU]) | 
| 101 | 4 |  |  |  |  | 18 | my $l = pi2 * frac( 0.6232469 + $m9 / pi2 + $dl / 1296.0E3 ); | 
| 102 | 4 |  |  |  |  | 12 | my $r = 40.7247248 + $dr * 1.0E-5; | 
| 103 | 4 |  |  |  |  | 16 | my $b = deg2rad(-3.909434) + $db / ARCS; | 
| 104 |  |  |  |  |  |  |  | 
| 105 |  |  |  |  |  |  | # Position vector; ecliptic and equinox of B1950.0 | 
| 106 | 4 |  |  |  |  | 51 | ( $l, $b ) = _prec( $t, $l, $b ); | 
| 107 |  |  |  |  |  |  |  | 
| 108 | 4 |  |  |  |  | 39 | $l, $b, $r; | 
| 109 |  |  |  |  |  |  | } | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | # Intermediate variables for calculating geocentric positions. | 
| 112 |  |  |  |  |  |  | sub _lbr_geo { | 
| 113 | 4 |  |  | 4 |  | 10 | my ( $self, $t ) = @_; | 
| 114 |  |  |  |  |  |  |  | 
| 115 | 4 |  |  |  |  | 15 | my $m = pi2 * frac( 0.0385795 + 0.4026667 * $t ); | 
| 116 | 4 |  |  |  |  | 14 | my $dl = | 
| 117 |  |  |  |  |  |  | 0.69 + 0.34 * cos($m) + 0.12 * cos( 2 * $m ) + 0.05 * cos( 3 * $m ); | 
| 118 | 4 |  |  |  |  | 15 | my $dr = 6.66 * sin($m) + 1.64 * sin( 2 * $m ); | 
| 119 | 4 |  |  |  |  | 14 | my $db = -0.08 * cos($m) - 0.17 * sin($m) - 0.09 * sin( 2 * $m ); | 
| 120 |  |  |  |  |  |  |  | 
| 121 | 4 |  |  |  |  | 11 | $dl, $db, $dr; | 
| 122 |  |  |  |  |  |  | } | 
| 123 |  |  |  |  |  |  |  | 
| 124 |  |  |  |  |  |  | sub _prec { | 
| 125 | 4 |  |  | 4 |  | 10 | my ( $t, $l, $b ) = @_; | 
| 126 |  |  |  |  |  |  |  | 
| 127 | 4 |  |  |  |  | 11 | my $d   = $t + 0.5; | 
| 128 | 4 |  |  |  |  | 8 | my $ppi = 3.044; | 
| 129 |  |  |  |  |  |  |  | 
| 130 | 4 |  |  |  |  | 9 | my $pk = 2.28E-4 * $d; | 
| 131 | 4 |  |  |  |  | 10 | my $p  = ( 0.0243764 + 5.39E-6 * $d ) * $d; | 
| 132 | 4 |  |  |  |  | 8 | my $c1 = cos($pk); | 
| 133 | 4 |  |  |  |  | 9 | my $c2 = cos($b); | 
| 134 | 4 |  |  |  |  | 13 | my $c3 = cos( $ppi - $l ); | 
| 135 | 4 |  |  |  |  | 7 | my $s1 = sin($pk); | 
| 136 | 4 |  |  |  |  | 13 | my $s2 = sin($b); | 
| 137 | 4 |  |  |  |  | 10 | my $s3 = sin( $ppi - $l ); | 
| 138 | 4 |  |  |  |  | 10 | my $x  = $c2 * $c3; | 
| 139 | 4 |  |  |  |  | 10 | my $y  = $c1 * $c2 * $s3 - $s1 * $s2; | 
| 140 | 4 |  |  |  |  | 8 | my $z  = $s1 * $c2 * $s3 + $c1 * $s2; | 
| 141 |  |  |  |  |  |  |  | 
| 142 | 4 |  |  |  |  | 28 | $b = atan( $z / sqrt( ( 1.0 - $z ) * ( 1.0 + $z ) ) ); | 
| 143 | 4 | 100 |  |  |  | 15 | if ( $x > 0 ) { | 
| 144 | 2 |  |  |  |  | 12 | $l = pi2 * frac( ( $ppi + $p - atan( $y / $x ) ) / pi2 ); | 
| 145 |  |  |  |  |  |  | } | 
| 146 |  |  |  |  |  |  | else { | 
| 147 | 2 |  |  |  |  | 14 | $l = pi2 * frac( ( $ppi + $p - atan( $y / $x ) ) / pi2 + 0.5 ); | 
| 148 |  |  |  |  |  |  | } | 
| 149 |  |  |  |  |  |  |  | 
| 150 | 4 |  |  |  |  | 13 | $l, $b; | 
| 151 |  |  |  |  |  |  | } | 
| 152 |  |  |  |  |  |  |  | 
| 153 |  |  |  |  |  |  | 1; | 
| 154 |  |  |  |  |  |  |  | 
| 155 |  |  |  |  |  |  | __END__ | 
| 156 |  |  |  |  |  |  |  | 
| 157 |  |  |  |  |  |  | =pod | 
| 158 |  |  |  |  |  |  |  | 
| 159 |  |  |  |  |  |  | =encoding UTF-8 | 
| 160 |  |  |  |  |  |  |  | 
| 161 |  |  |  |  |  |  | =head1 NAME | 
| 162 |  |  |  |  |  |  |  | 
| 163 |  |  |  |  |  |  | Astro::Montenbruck::Ephemeris::Planet::Pluto - Pluto. | 
| 164 |  |  |  |  |  |  |  | 
| 165 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 166 |  |  |  |  |  |  |  | 
| 167 |  |  |  |  |  |  | use Astro::Montenbruck::Ephemeris::Planet::Pluto; | 
| 168 |  |  |  |  |  |  | my $planet = Astro::Montenbruck::Ephemeris::Planet::Pluto->new(); | 
| 169 |  |  |  |  |  |  | my @geo = $planet->position($t); # apparent geocentric ecliptical coordinates | 
| 170 |  |  |  |  |  |  |  | 
| 171 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 172 |  |  |  |  |  |  |  | 
| 173 |  |  |  |  |  |  | Child class of L<Astro::Montenbruck::Ephemeris::Planet>, responsible for calculating | 
| 174 |  |  |  |  |  |  | B<Pluto> position. | 
| 175 |  |  |  |  |  |  |  | 
| 176 |  |  |  |  |  |  | The coordinates are first calculated relative to the fixed ecliptic of 1950, and | 
| 177 |  |  |  |  |  |  | then transformed to the equinox of date. This method is nesessary because of | 
| 178 |  |  |  |  |  |  | the high inclination of Pluto's orbit. | 
| 179 |  |  |  |  |  |  |  | 
| 180 |  |  |  |  |  |  | =head1 CAVEATS | 
| 181 |  |  |  |  |  |  |  | 
| 182 |  |  |  |  |  |  | The routine is applicable only between years B<1890> and B<2100>. | 
| 183 |  |  |  |  |  |  |  | 
| 184 |  |  |  |  |  |  | The reason for this is that the series expansion used was not derived from | 
| 185 |  |  |  |  |  |  | perturbation theory, but from a Fourier analysis of a numerically integrated | 
| 186 |  |  |  |  |  |  | ephemeris covering this period of time. Even a few years before 1890 or after | 
| 187 |  |  |  |  |  |  | 2100, the errors in the calculated coordinates grow very sharply, reaqching | 
| 188 |  |  |  |  |  |  | values of more than 0.5 arc-degrees. | 
| 189 |  |  |  |  |  |  |  | 
| 190 |  |  |  |  |  |  | â O.Montenbruck, Th.Pfleger "Astronomy on the Personal Computer" | 
| 191 |  |  |  |  |  |  |  | 
| 192 |  |  |  |  |  |  | =head1 METHODS | 
| 193 |  |  |  |  |  |  |  | 
| 194 |  |  |  |  |  |  | =head2 Astro::Montenbruck::Ephemeris::Planet::Pluto->new | 
| 195 |  |  |  |  |  |  |  | 
| 196 |  |  |  |  |  |  | Constructor. | 
| 197 |  |  |  |  |  |  |  | 
| 198 |  |  |  |  |  |  | =head2 $self->heliocentric($t) | 
| 199 |  |  |  |  |  |  |  | 
| 200 |  |  |  |  |  |  | See description in L<Astro::Montenbruck::Ephemeris::Planet>. | 
| 201 |  |  |  |  |  |  |  | 
| 202 |  |  |  |  |  |  | =head1 AUTHOR | 
| 203 |  |  |  |  |  |  |  | 
| 204 |  |  |  |  |  |  | Sergey Krushinsky, C<< <krushi at cpan.org> >> | 
| 205 |  |  |  |  |  |  |  | 
| 206 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 207 |  |  |  |  |  |  |  | 
| 208 |  |  |  |  |  |  | Copyright (C) 2009-2019 by Sergey Krushinsky | 
| 209 |  |  |  |  |  |  |  | 
| 210 |  |  |  |  |  |  | This library is free software; you can redistribute it and/or modify | 
| 211 |  |  |  |  |  |  | it under the same terms as Perl itself. | 
| 212 |  |  |  |  |  |  |  | 
| 213 |  |  |  |  |  |  | =cut |