lib/Astro/Montenbruck/NutEqu.pm

filter: Statementstmt 100% 48 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 3 / 3 totaltotal 100% 62 / 62 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Astro/Montenbruck/Ephemeris/Planet/Venus.pm ↑ Summary lib/Astro/Montenbruck/RiseSet/Constants.pm »
1 package Astro::Montenbruck::NutEqu;
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 ▶use Exporter qw/import/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 ▶use Math::Trig qw/:pi/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use Astro::Montenbruck::MathUtils qw/frac ARCS polynome/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 8 our @EXPORT_OK = qw/mean2true obliquity deltas/;
11 8 our $VERSION = 0.02;
12  
13 1369 ▶sub deltas {
Subroutine deltas: called CC=1 SCAR=0.0
Pod documented
14 1369 my $t = shift;
15  
16 1369 my $ls = pi2 * frac( 0.993133 + 99.997306 * $t ); # mean anomaly Sun
17 1369 my $d = pi2 * frac( 0.827362 + 1236.853087 * $t ); # diff. longitude Moon-Sun
18 1369 my $f = pi2 * frac( 0.259089 + 1342.227826 * $t ); # mean argument of latitude
19 1369 my $n = pi2 * frac( 0.347346 - 5.372447 * $t ); # longit. ascending node
20  
21 1369 my $dpsi =
22 ( -17.200 * sin($n) -
23 1.319 * sin( 2 * ( $f - $d + $n ) ) -
24 0.227 * sin( 2 * ( $f + $n ) ) +
25 0.206 * sin( 2 * $n ) +
26 0.143 * sin($ls) ) / ARCS;
27 1369 my $deps =
28 ( +9.203 * cos($n) +
29 0.574 * cos( 2 * ( $f - $d + $n ) ) +
30 0.098 * cos( 2 * ( $f + $n ) ) -
31 0.090 * cos( 2 * $n ) ) / ARCS;
32  
33 1369 $dpsi, $deps
34 }
35  
36  
37 # Conversion of ecliptic into equatorial coordinates
38 721 ▶sub _eclequ {
Subroutine _eclequ: called CC=1 SCAR=0.0
39 721 my ($rct, $cos_eps, $sin_eps) = @_;
40 721 my ($x, $y, $z) = @$rct;
41 721 $x, $cos_eps * $y - $sin_eps * $z, $sin_eps * $y + $cos_eps * $z
42 }
43  
44 # Conversion of equatorial rectangular into ecliptic rectangular coordinates
45 721 ▶sub _equecl {
Subroutine _equecl: called CC=1 SCAR=0.0
46 721 my ($rct, $cos_eps, $sin_eps) = @_;
47 721 my ($x, $y, $z) = @$rct;
48 721 $x, $cos_eps * $y + $sin_eps * $z, -$sin_eps * $y + $cos_eps * $z
49 }
50  
51  
52 711 ▶sub mean2true {
Subroutine mean2true: called CC=1 SCAR=0.0
Pod documented
53 711 my $t = shift;
54 711 my ($dpsi, $deps) = deltas($t);
55 711 my $eps = 0.4090928 - 2.2696E-4 * $t; # obliquity of the ecliptic
56 711 my $ce = cos($eps);
57 711 my $se = sin($eps);
58
59 711 my $c = $dpsi * $ce;
60 711 my $s = $dpsi * $se;
61  
62 721 ▶ sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
63 721 my $ecl = shift;
64 721 my ($x, $y, $z) = _eclequ($ecl, $ce, $se);
65 721 my $dx = -( $c * $y + $s * $z );
66 721 my $dy = ( $c * $x - $deps * $z );
67 721 my $dz = ( $s * $x + $deps * $y );
68 721 _equecl([$x + $dx, $y + $dy, $z + $dz], $ce, $se);
69 }
70 711 }
71  
72 1124 ▶sub obliquity {
Subroutine obliquity: called CC=1 SCAR=0.0
Pod documented
73 1124 my $t = shift;
74 1124 23.43929111 - (46.815 + (0.00059 - 0.001813 * $t) * $t) * $t / 3600
75 }
76  
77  
78 8 1;
79  
80 __END__
« lib/Astro/Montenbruck/Ephemeris/Planet/Venus.pm ↑ Summary lib/Astro/Montenbruck/RiseSet/Constants.pm »