line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GIS::Distance::Polar; |
2
|
1
|
|
|
1
|
|
21
|
use 5.008001; |
|
1
|
|
|
|
|
3
|
|
3
|
1
|
|
|
1
|
|
6
|
use strictures 2; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
40
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
238
|
use parent 'GIS::Distance::Formula'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
91
|
use Math::Trig qw( deg2rad pi ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
9
|
1
|
|
|
1
|
|
426
|
use GIS::Distance::Constants qw( :all ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
108
|
|
10
|
1
|
|
|
1
|
|
7
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _distance { |
13
|
1
|
|
|
1
|
|
3
|
my ($lat1, $lon1, $lat2, $lon2) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
$lon1 = deg2rad($lon1); |
16
|
1
|
|
|
|
|
11
|
$lat1 = deg2rad($lat1); |
17
|
1
|
|
|
|
|
8
|
$lon2 = deg2rad($lon2); |
18
|
1
|
|
|
|
|
7
|
$lat2 = deg2rad($lat2); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
7
|
my $a = pi/2 - $lat1; |
21
|
1
|
|
|
|
|
2
|
my $b = pi/2 - $lat2; |
22
|
1
|
|
|
|
|
5
|
my $c = sqrt( $a ** 2 + $b ** 2 - 2 * $a * $b * cos($lon2 - $lon1) ); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
3
|
return $KILOMETER_RHO * $c; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
__END__ |