line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Formatter::CalcurateDMS; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
30
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
149
|
|
4
|
6
|
|
|
6
|
|
26
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
158
|
|
5
|
6
|
|
|
6
|
|
28
|
use Carp; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
291
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
31
|
use version; our $VERSION = qv('0.0.1'); |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
32
|
|
8
|
6
|
|
|
6
|
|
487
|
use vars qw(@ISA @EXPORT); |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
390
|
|
9
|
6
|
|
|
6
|
|
32
|
use Exporter; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
1165
|
|
10
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
@EXPORT = qw(__degree2dms __dms2degree); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub __degree2dms { |
14
|
12
|
|
|
12
|
|
19
|
my $degree = shift; |
15
|
|
|
|
|
|
|
|
16
|
12
|
100
|
|
|
|
41
|
my $minus = $degree < 0 ? 1 : 0; |
17
|
12
|
|
|
|
|
17
|
$degree = abs($degree); |
18
|
12
|
|
|
|
|
38
|
my $minute = ($degree - int($degree)) * 60; |
19
|
12
|
|
|
|
|
18
|
my $second = ($minute - int($minute)) * 60; |
20
|
|
|
|
|
|
|
|
21
|
12
|
|
|
|
|
43
|
return ($minus,int($degree),int($minute),$second); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub __dms2degree { |
25
|
16
|
|
|
16
|
|
31
|
my ($minus,$degree,$minute,$second) = @_; |
26
|
|
|
|
|
|
|
|
27
|
16
|
|
|
|
|
61
|
$degree = int($degree) + int($minute) / 60 + $second / 3600; |
28
|
16
|
100
|
|
|
|
39
|
$degree *= -1 if ($minus); |
29
|
|
|
|
|
|
|
|
30
|
16
|
|
|
|
|
82
|
return $degree; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |