Math::FresnelZone - Perl extension for calculating the Fresnel Zone Radius of a given distance and frequency
use Math::FresnelZone; use Math::FresnelZone qw(fresnel fresnelMi fresnelKm);
The arguments are:
0 - distance in kilometers or miles (default is 1), 1 - frequency in GHz (defualt 2.4), 2 - set to true to specify that the distance you are inputting is in miles and that the results should be in in feet (default is 0 - IE kilometers/meters)
my $fresnel_zone_radius_in_meters = fresnel(); # fresnel zone radius in meters for 1 kilometer at 2.4 GHz my $fzr_in_meters = fresnel(5); # fresnel zone radius in meters for 5 kilometers at 2.4 GHz my $fzr_in_meters = fresnel(5,4.8); # fresnel zone radius in meters for 5 kilometers at 4.8 GHz my $fzr_in_feet = fresnel(3,9.6,1); # fresnel zone in feet for 3 miles at 9.6 GHz
If you are inputting Kilometers the result is in meters (these 3 calls have identical results):
fresnel($Km,$GHz); fresnelKm($Km,$GHz); # see documentaion below for info about fresnelKm() fresnel($Km,$GHz,0);
If you are inputting Miles (by specifying a true value as the 3rd argument) the result is in feet (these 2 calls have identical results)
fresnel($Mi,$GHz,1); fresnelMi($Mi,$GHz); # see documentaion below for info about fresnelMi()
You can use this to make it easier to avoid ambiguity if are working in kilometers/meters. It takes the first two arguments only: distance in kilometers and frequency in GigaHertz
my $fzr_in_meters = fresnelKm($Km,$GHz);
You can use this to make it easier to avoid ambiguity if are working in miles/feet. It takes the first two arguments only: distance in miles and frequency in GigaHertz
my $fzr_in_feet = fresnelMi($Mi,$GHz);
None by default. You can export any of the 3 functions as in the synopsis example.
These variables are used when using miles/feet instead of kilometers/meters to modify the input for the formula and the output for the user:
$Math::FresnelZone::KILOMETERS_IN_A_MILE (Default is 1.609344) $Math::FresnelZone::FEET_IN_A_METER (Defualt is 3.280839)
Feel free to change them if you need more or less than six decimal places and/or want really inaccurate results :)
To find out more about the fresnel zone (pronounced fray-NELL) you can google the man who this formula/zone is named after to learn more: Augustin Jean Fresnel.
Mr. Fresnel was a French physicist who supported the wave theory of light, investigated polarized light, and developed a compound lens for use in lighthouses (IE the "Fresnel lens") (1788-1827).
Also googling the phrase "Fresnel Zone" turns up some interesting glossary refernces to what the fresnel zone is.
Here is a link to an image illustrating what a fresnel zone is and the formula: http://drmuey.com/images/fresnelzone.jpg
Daniel Muey, http://drmuey.com/cpan_contact.pl
Copyright 2004 by Daniel Muey
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.