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