| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Zodiac::Angle; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
295300
|
use strict; |
|
|
4
|
|
|
|
|
37
|
|
|
|
4
|
|
|
|
|
115
|
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
111
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1961
|
use Class::Utils qw(set_params); |
|
|
4
|
|
|
|
|
110212
|
|
|
|
4
|
|
|
|
|
87
|
|
|
7
|
4
|
|
|
4
|
|
268
|
use Readonly; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
152
|
|
|
8
|
4
|
|
|
4
|
|
1465
|
use Unicode::UTF8 qw(decode_utf8); |
|
|
4
|
|
|
|
|
1382
|
|
|
|
4
|
|
|
|
|
1292
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Readonly::Hash our %ZODIAC => ( |
|
11
|
|
|
|
|
|
|
1 => decode_utf8('♈'), |
|
12
|
|
|
|
|
|
|
2 => decode_utf8('♉'), |
|
13
|
|
|
|
|
|
|
3 => decode_utf8('♊'), |
|
14
|
|
|
|
|
|
|
4 => decode_utf8('♋'), |
|
15
|
|
|
|
|
|
|
5 => decode_utf8('♌'), |
|
16
|
|
|
|
|
|
|
6 => decode_utf8('♍'), |
|
17
|
|
|
|
|
|
|
7 => decode_utf8('♎'), |
|
18
|
|
|
|
|
|
|
8 => decode_utf8('♏'), |
|
19
|
|
|
|
|
|
|
9 => decode_utf8('♐'), |
|
20
|
|
|
|
|
|
|
10 => decode_utf8('♑'), |
|
21
|
|
|
|
|
|
|
11 => decode_utf8('♒'), |
|
22
|
|
|
|
|
|
|
12 => decode_utf8('♓'), |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = 0.02; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Constructor. |
|
28
|
|
|
|
|
|
|
sub new { |
|
29
|
2
|
|
|
2
|
1
|
176
|
my ($class, @params) = @_; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Create object. |
|
32
|
2
|
|
|
|
|
8
|
my $self = bless {}, $class; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Process parameters. |
|
35
|
2
|
|
|
|
|
11
|
set_params($self, @params); |
|
36
|
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
20
|
return $self; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub angle2zodiac { |
|
41
|
2
|
|
|
2
|
1
|
777
|
my ($self, $angle) = @_; |
|
42
|
|
|
|
|
|
|
|
|
43
|
2
|
|
|
|
|
5
|
my $full_angle_degree = int($angle); |
|
44
|
2
|
|
|
|
|
6
|
$angle -= $full_angle_degree; |
|
45
|
2
|
|
|
|
|
5
|
$angle *= 60; |
|
46
|
2
|
|
|
|
|
3
|
my $angle_minute = int($angle); |
|
47
|
2
|
|
|
|
|
5
|
my $sign = int($full_angle_degree / 30); |
|
48
|
2
|
|
|
|
|
3
|
my $angle_degree = $full_angle_degree - ($sign * 30); |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $zodiac_angle = $angle_degree.decode_utf8('°'). |
|
51
|
2
|
|
|
|
|
21
|
$ZODIAC{$sign + 1}.$angle_minute.decode_utf8("′"); |
|
52
|
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
30
|
return $zodiac_angle; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub zodiac2angle { |
|
57
|
0
|
|
|
0
|
1
|
|
my ($self, $zodiac_angle) = @_; |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# TODO |
|
60
|
0
|
|
|
|
|
|
my $angle; |
|
61
|
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return $angle; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |