#!user/bin/perl; #dipole.pl # ########################### # Simple programme to calculate approximate dipole lengths, used in talk # at RSGB HF & IOTA Convention, 24-Oct-04 # # Version: 1.0 (20 Oct 04) # # Copyright (c) 2004 Dominic Smith, M0BLF # Released under GNU GPL available from # http://www.gnu.org/copyleft/gpl.html # # ----- LICENCE ----- # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -------------------- # # For information about this programme, email m0blf@domsmith.co.uk # ########################### use strict; use warnings; our $freq; our $wave; our $halfwave; our $halfwave_imp; our $quarterwave; our $quarterwave_imp; sub round { my $roundthis; # Rounds to three decimal places my($roundthis) = shift; $roundthis = $roundthis*1000; $roundthis = int($roundthis); $roundthis = $roundthis/1000; return ($roundthis); } system("cls"); #Warning - will only work on DOS-based platforms! print "Dipole Calculator\n"; print "------ ----------\n"; print "Dipole Calculator v 1.0, by Dominic Smith M0BLF \nSee source code for GPL licence information\n"; print "-----------------\n\n"; print "Please input a frequency in Megahertz, between 0.1 and 1325:\n"; chomp($freq = ); if ($freq > 0.1 && $freq <1325) { $wave = round(300/$freq); $halfwave = round($wave/2); $halfwave_imp = round($halfwave/0.3048); $quarterwave = round($wave/4); $quarterwave_imp = round($quarterwave/0.3048); print "\n\n"; print "\tFrequency\t=\t$freq MHz\n"; print "\tWavelength\t=\t$wave m\n"; print "\n"; print "\tTotal Length\t=\t$halfwave m ($halfwave_imp ft)\n"; print "\n"; print " $quarterwave m $quarterwave m\n"; print " --------------------\\ \/-------------------\n"; print " ||\n"; print " $quarterwave_imp ft $quarterwave_imp ft\n"; print "\nAll measurements are rounded and are approximate. \nDon\'t forget to make the dipole too long first - \n"; print "It\'s easier to cut wire than add more afterwards!\n"; } else { print "Aborting. Frequency out of range.\n"; } # EOF