#!/usr/bin/env perl

## Slim Jim Antenna Designer
##
## Required hardware:
##
## * 3m of 40mm diameter white PVC pipe
## * 3m of 19mm diameter white PVC pipe 
## * 2 40mm diameter PVC end caps 
## * 6m thick (18swg, 1.25mm diameter minimum) single core copper 
##   wire, (tinned, enamelled or insulated) 
## * 25cm RG58C/U or similar 5.5mm diameter 50W coax cable 
## * UHF (SO239) or N-type 4 hole square chassis socket 
## * 4 sets nuts, bolts, washers to suit the above socket and solder tags 
## * PVC insulating tape  
##
## see http://www.irational.org/sic/radio/omni-aerial.html for more information

## This file Copyright 2000 <contact@gbppr.org> under the GPL
## NO WARRANTY. Please send bug reports / patches / reports.

sub Print {                             
print "\33[H\33[J".
" The Slim Jim Antenna                                                \n".
"               +-----+                                               \n".
"               ||~~~||  <------------------------------------+       \n".
"               || P ||                                       |       \n".
" Wrap wire     || V ||                                       |       \n".
" around 19 mm  || C ||                                       |       \n".
" dia PVC pipe  ||   ||                                       |       \n".
"               ||   ||                                       |       \n".
"               ||   ||                                       |       \n".
"               ||   ||  <------ Wire Stop Point              |       \n".
"               ||   |                                        |       \n".
" @ = hole in   || @ ||  <--------+  Break Point (start)      |       \n".
" @   PVC for   || @ ||  <-----+  |  Feed Point Distance      |       \n".
"     coax      ||   ||        |  |                           |       \n".
"               |~~~~ |  <-----+--+ Overall Length -----------+       \n".
"               +-----+                                               \n";
}

print "\n\n\t\tSlim Jim Antenna Designer\n\n";

while (!$frq) {
        print "Enter frequency antenna will be used at (in MHz): ";
        chomp($frq = <STDIN>);
        $frq =~ tr/0-9.//csd;
}    

# 98 MHz is reference frequency
#
$over = 220.5 / $frq * 98; 
$feed = 11.1 / $frq * 98;
$break = 71 / $frq * 98;

&Print;

print  "\n\n            Frequency : $frq MHz\n";
printf "       Overall Length : %.2f cm\n".
       "  Feed Point Distance : %.2f cm\n".
       " Break Point Distance : %.2f cm\n\n", $over, $feed, $break;
