line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GIS::Distance::Polar; |
2
|
1
|
|
|
1
|
|
19
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
7
|
use strictures 2; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
42
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.18'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
242
|
use parent 'GIS::Distance::Formula'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
63
|
use Math::Trig qw( deg2rad pi ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
9
|
1
|
|
|
1
|
|
424
|
use GIS::Distance::Constants qw( :all ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
110
|
|
10
|
1
|
|
|
1
|
|
8
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _distance { |
13
|
1
|
|
|
1
|
|
3
|
my ($lat1, $lon1, $lat2, $lon2) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
$lon1 = deg2rad($lon1); |
16
|
1
|
|
|
|
|
10
|
$lat1 = deg2rad($lat1); |
17
|
1
|
|
|
|
|
9
|
$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
|
|
|
|
|
6
|
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__ |