line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::FresnelZone; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
30881
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
269
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(fresnel fresnelMi fresnelKm); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $KILOMETERS_IN_A_MILE = 1.609344; |
13
|
|
|
|
|
|
|
our $FEET_IN_A_METER = 3.280839; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub fresnel { |
16
|
0
|
|
0
|
0
|
1
|
|
my $d = shift || 1; |
17
|
0
|
|
0
|
|
|
|
my $f = shift || 2.4; |
18
|
0
|
|
0
|
|
|
|
my $m = shift || 0; |
19
|
0
|
0
|
|
|
|
|
$d = $d * $KILOMETERS_IN_A_MILE if $m; # convert miles into kilometers |
20
|
0
|
|
|
|
|
|
my $fz = 72.6*sqrt($d/(4*$f)); |
21
|
0
|
0
|
|
|
|
|
$fz = $fz * $FEET_IN_A_METER if $m; # convert meters back into feet |
22
|
0
|
|
|
|
|
|
return $fz; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
1
|
|
sub fresnelMi { fresnel(shift,shift,1); } |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
0
|
1
|
|
sub fresnelKm { fresnel(shift,shift,0); } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |