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