line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::Montenbruck::NutEqu; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
764
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
181
|
|
4
|
6
|
|
|
6
|
|
31
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
187
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
31
|
use Exporter qw/import/; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
170
|
|
7
|
6
|
|
|
6
|
|
88
|
use Math::Trig qw/:pi/; |
|
6
|
|
|
|
|
43
|
|
|
6
|
|
|
|
|
650
|
|
8
|
6
|
|
|
6
|
|
40
|
use Astro::Montenbruck::MathUtils qw/frac ARCS polynome/; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
2641
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw/mean2true obliquity deltas/; |
11
|
|
|
|
|
|
|
our $VERSION = 0.01; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub deltas { |
14
|
657
|
|
|
657
|
1
|
3540
|
my $t = shift; |
15
|
|
|
|
|
|
|
|
16
|
657
|
|
|
|
|
1855
|
my $ls = pi2 * frac( 0.993133 + 99.997306 * $t ); # mean anomaly Sun |
17
|
657
|
|
|
|
|
1693
|
my $d = pi2 * frac( 0.827362 + 1236.853087 * $t ); # diff. longitude Moon-Sun |
18
|
657
|
|
|
|
|
1462
|
my $f = pi2 * frac( 0.259089 + 1342.227826 * $t ); # mean argument of latitude |
19
|
657
|
|
|
|
|
1492
|
my $n = pi2 * frac( 0.347346 - 5.372447 * $t ); # longit. ascending node |
20
|
|
|
|
|
|
|
|
21
|
657
|
|
|
|
|
2393
|
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
|
657
|
|
|
|
|
2084
|
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
|
657
|
|
|
|
|
1646
|
$dpsi, $deps |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub mean2true { |
37
|
32
|
|
|
32
|
1
|
4255
|
my $t = shift; |
38
|
32
|
|
|
|
|
71
|
my ($dpsi, $deps) = deltas($t); |
39
|
32
|
|
|
|
|
70
|
my $eps = 0.4090928 - 2.2696E-4 * $t; # obliquity of the ecliptic |
40
|
32
|
|
|
|
|
63
|
my $c = $dpsi * cos($eps); |
41
|
32
|
|
|
|
|
61
|
my $s = $dpsi * sin($eps); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub { |
44
|
46
|
|
|
46
|
|
108
|
my ($x, $y, $z) = @_; |
45
|
46
|
|
|
|
|
115
|
my $dx = -( $c * $y + $s * $z ); |
46
|
46
|
|
|
|
|
89
|
my $dy = ( $c * $x - $deps * $z ); |
47
|
46
|
|
|
|
|
85
|
my $dz = ( $s * $x + $deps * $y ); |
48
|
|
|
|
|
|
|
|
49
|
46
|
|
|
|
|
153
|
$x + $dx, $y + $dy, $z + $dz |
50
|
|
|
|
|
|
|
} |
51
|
32
|
|
|
|
|
194
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub obliquity { |
54
|
1081
|
|
|
1081
|
1
|
4561
|
my $t = shift; |
55
|
1081
|
|
|
|
|
3612
|
23.43929111 - (46.815 + (0.00059 - 0.001813 * $t) * $t) * $t / 3600 |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=pod |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=encoding UTF-8 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 NAME |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Astro::Montenbruck::Ephemeris::Planet - Base class for a planet. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SYNOPSIS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# given mean geocentric coordinates $x0, $y0, $z0, |
75
|
|
|
|
|
|
|
# transform them to apparent coordinates $x1, $y1, $z1 |
76
|
|
|
|
|
|
|
my $func = nutequ( $t ); |
77
|
|
|
|
|
|
|
($x1, $y1, $z1) = $func->($x0, $y0, $z0); # true coordinates |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DESCRIPTION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Base class for a planet. Designed to be extended. Used internally in |
82
|
|
|
|
|
|
|
Astro::Montenbruck::Ephemeris modules. Subclasses must implement B<heliocentric> |
83
|
|
|
|
|
|
|
method. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SUBROUTINES |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 deltas( $t ) |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Calculates the effects of nutation on the ecliptic longitude and on the |
90
|
|
|
|
|
|
|
obliquity of the ecliptic with accuracy of about 1 arcsecond. |
91
|
|
|
|
|
|
|
Given time in Julian centuries since J200, return delta-psi and delta-eps. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head3 Arguments |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=over |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * B<$t> â time in Julian centuries since J2000: C<(JD-2451545.0)/36525.0> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head3 Returns |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
C<($delta_psi, $delta_eps)>, in arc-degrees. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head2 mean2true( $t ) |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Returns function for transforming of mean to true coordinates. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head3 Arguments |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=over |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * B<$t> â time in Julian centuries since J2000: C<(JD-2451545.0)/36525.0> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=back |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head3 Returns |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Function which takes I<mean> ecliptic geocentric coordinates of the planet X, Y, Z |
121
|
|
|
|
|
|
|
of a planet and returns I<true> coordinates, i.e. corrected for |
122
|
|
|
|
|
|
|
L<nutation in ecliptic and obliquity>. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 obliquity( $t ) |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Given time in Julian centuries since J200, return I<mean obliquity of the ecliptic>, |
127
|
|
|
|
|
|
|
in arc-degrees. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 AUTHOR |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Sergey Krushinsky, C<< <krushi at cpan.org> >> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Copyright (C) 2009-2019 by Sergey Krushinsky |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
138
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |