line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Astro::Montenbruck::NutEqu; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
88798
|
use strict; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
201
|
|
4
|
8
|
|
|
8
|
|
36
|
use warnings; |
|
8
|
|
|
|
|
21
|
|
|
8
|
|
|
|
|
190
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
34
|
use Exporter qw/import/; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
194
|
|
7
|
8
|
|
|
8
|
|
566
|
use Math::Trig qw/:pi/; |
|
8
|
|
|
|
|
12983
|
|
|
8
|
|
|
|
|
760
|
|
8
|
8
|
|
|
8
|
|
448
|
use Astro::Montenbruck::MathUtils qw/frac ARCS polynome/; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
4075
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw/mean2true obliquity deltas/; |
11
|
|
|
|
|
|
|
our $VERSION = 0.02; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub deltas { |
14
|
1369
|
|
|
1369
|
1
|
4285
|
my $t = shift; |
15
|
|
|
|
|
|
|
|
16
|
1369
|
|
|
|
|
3423
|
my $ls = pi2 * frac( 0.993133 + 99.997306 * $t ); # mean anomaly Sun |
17
|
1369
|
|
|
|
|
3177
|
my $d = pi2 * frac( 0.827362 + 1236.853087 * $t ); # diff. longitude Moon-Sun |
18
|
1369
|
|
|
|
|
2666
|
my $f = pi2 * frac( 0.259089 + 1342.227826 * $t ); # mean argument of latitude |
19
|
1369
|
|
|
|
|
3141
|
my $n = pi2 * frac( 0.347346 - 5.372447 * $t ); # longit. ascending node |
20
|
|
|
|
|
|
|
|
21
|
1369
|
|
|
|
|
4733
|
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
|
|
|
|
|
3764
|
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
|
|
|
|
|
2958
|
$dpsi, $deps |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Conversion of ecliptic into equatorial coordinates |
38
|
|
|
|
|
|
|
sub _eclequ { |
39
|
721
|
|
|
721
|
|
1457
|
my ($rct, $cos_eps, $sin_eps) = @_; |
40
|
721
|
|
|
|
|
1446
|
my ($x, $y, $z) = @$rct; |
41
|
721
|
|
|
|
|
1943
|
$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
|
|
|
|
|
|
|
sub _equecl { |
46
|
721
|
|
|
721
|
|
1340
|
my ($rct, $cos_eps, $sin_eps) = @_; |
47
|
721
|
|
|
|
|
1421
|
my ($x, $y, $z) = @$rct; |
48
|
721
|
|
|
|
|
2112
|
$x, $cos_eps * $y + $sin_eps * $z, -$sin_eps * $y + $cos_eps * $z |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub mean2true { |
53
|
711
|
|
|
711
|
1
|
10918
|
my $t = shift; |
54
|
711
|
|
|
|
|
1463
|
my ($dpsi, $deps) = deltas($t); |
55
|
711
|
|
|
|
|
1192
|
my $eps = 0.4090928 - 2.2696E-4 * $t; # obliquity of the ecliptic |
56
|
711
|
|
|
|
|
1236
|
my $ce = cos($eps); |
57
|
711
|
|
|
|
|
915
|
my $se = sin($eps); |
58
|
|
|
|
|
|
|
|
59
|
711
|
|
|
|
|
1105
|
my $c = $dpsi * $ce; |
60
|
711
|
|
|
|
|
981
|
my $s = $dpsi * $se; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub { |
63
|
721
|
|
|
721
|
|
1173
|
my $ecl = shift; |
64
|
721
|
|
|
|
|
1700
|
my ($x, $y, $z) = _eclequ($ecl, $ce, $se); |
65
|
721
|
|
|
|
|
1559
|
my $dx = -( $c * $y + $s * $z ); |
66
|
721
|
|
|
|
|
1179
|
my $dy = ( $c * $x - $deps * $z ); |
67
|
721
|
|
|
|
|
1042
|
my $dz = ( $s * $x + $deps * $y ); |
68
|
721
|
|
|
|
|
2047
|
_equecl([$x + $dx, $y + $dy, $z + $dz], $ce, $se); |
69
|
|
|
|
|
|
|
} |
70
|
711
|
|
|
|
|
3449
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub obliquity { |
73
|
1124
|
|
|
1124
|
1
|
4277
|
my $t = shift; |
74
|
1124
|
|
|
|
|
3763
|
23.43929111 - (46.815 + (0.00059 - 0.001813 * $t) * $t) * $t / 3600 |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=pod |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=encoding UTF-8 |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 NAME |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Astro::Montenbruck::NutEqu - Obliquity of the ecliptic & nutation. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 SYNOPSIS |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# given mean geocentric coordinates $x0, $y0, $z0, |
94
|
|
|
|
|
|
|
# transform them to apparent coordinates $x1, $y1, $z1 |
95
|
|
|
|
|
|
|
my $func = nutequ( $t ); |
96
|
|
|
|
|
|
|
($x1, $y1, $z1) = $func->($x0, $y0, $z0); # true coordinates |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 DESCRIPTION |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Functions dealing with ecliptic obliquity. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 SUBROUTINES |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 deltas( $t ) |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Calculates the effects of nutation on the ecliptic longitude and on the |
107
|
|
|
|
|
|
|
obliquity of the ecliptic with accuracy of about 1 arcsecond. |
108
|
|
|
|
|
|
|
Given time in Julian centuries since J2000, return delta-psi and delta-eps. |
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
|
|
|
|
|
|
|
C<($delta_psi, $delta_eps)>, in arc-degrees. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 mean2true($t) |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Returns function for transforming of mean to true coordinates. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head3 Arguments |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=over |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * B<$t> — time in Julian centuries since J2000: C<(JD-2451545.0)/36525.0> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=back |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head3 Returns |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Function which takes mean ecliptic geocentric rectangular coordinates C<X, Y, Z> |
138
|
|
|
|
|
|
|
of a planet and returns ecliptic rectangular coordinates, referred to the I<equinox of date>. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head2 obliquity( $t ) |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Given time in Julian centuries since J2000, return I<mean obliquity of the ecliptic>, |
144
|
|
|
|
|
|
|
in arc-degrees. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 AUTHOR |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Sergey Krushinsky, C<< <krushi at cpan.org> >> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Copyright (C) 2009-2022 by Sergey Krushinsky |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
155
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |