line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GIS::Distance::GreatCircle; |
2
|
1
|
|
|
1
|
|
19
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
3
|
1
|
|
|
1
|
|
5
|
use strictures 2; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
40
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
186
|
use parent 'GIS::Distance::Formula'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
74
|
use Math::Trig qw( deg2rad asin ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
9
|
1
|
|
|
1
|
|
6
|
use GIS::Distance::Constants qw( :all ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
119
|
|
10
|
1
|
|
|
1
|
|
7
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _distance { |
13
|
5
|
|
|
5
|
|
12
|
my ($lat1, $lon1, $lat2, $lon2) = @_; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
|
|
14
|
$lon1 = deg2rad($lon1); |
16
|
5
|
|
|
|
|
52
|
$lat1 = deg2rad($lat1); |
17
|
5
|
|
|
|
|
33
|
$lon2 = deg2rad($lon2); |
18
|
5
|
|
|
|
|
34
|
$lat2 = deg2rad($lat2); |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
50
|
my $c = 2*asin( sqrt( |
21
|
|
|
|
|
|
|
( sin(($lat1-$lat2)/2) )**2 + |
22
|
|
|
|
|
|
|
cos($lat1) * cos($lat2) * |
23
|
|
|
|
|
|
|
( sin(($lon1-$lon2)/2) )**2 |
24
|
|
|
|
|
|
|
) ); |
25
|
|
|
|
|
|
|
|
26
|
5
|
|
|
|
|
42
|
return $KILOMETER_RHO * $c; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |