line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GIS::Distance::GreatCircle; |
2
|
1
|
|
|
1
|
|
18
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
3
|
1
|
|
|
1
|
|
7
|
use strictures 2; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
40
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.18'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
183
|
use parent 'GIS::Distance::Formula'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
79
|
use Math::Trig qw( deg2rad asin ); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
53
|
|
9
|
1
|
|
|
1
|
|
6
|
use GIS::Distance::Constants qw( :all ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
92
|
|
10
|
1
|
|
|
1
|
|
6
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _distance { |
13
|
5
|
|
|
5
|
|
10
|
my ($lat1, $lon1, $lat2, $lon2) = @_; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
|
|
11
|
$lon1 = deg2rad($lon1); |
16
|
5
|
|
|
|
|
59
|
$lat1 = deg2rad($lat1); |
17
|
5
|
|
|
|
|
36
|
$lon2 = deg2rad($lon2); |
18
|
5
|
|
|
|
|
31
|
$lat2 = deg2rad($lat2); |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
|
|
51
|
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
|
|
|
|
|
43
|
return $KILOMETER_RHO * $c; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |