Skip to topic | Skip to bottom
Home
SVWUX
SVWUX.CalculatingBeamWidthr1.1 - 06 Nov 2008 - 21:48 - IanKlufttopic end

Start of topic | Skip to actions

Calculating Beam Width

The question came up during the November 6, 2008 SVWUX meeting about how to calculate the beam width in miles at a given distance and angle for an antenna. I wrote this script during the meeting to calculate the result.

#!/usr/bin/perl
# beamwidth calculator
# by Ian Kluft
# written at the Nov 6, 2008 SVWUX meeting to answer a question

use strict;
use Math::Trig;
use Getopt::Long;

my $angle_deg = -1;
my $dist_mi = -1;
my $result = GetOptions (
        "angle:i" => \$angle_deg,
        "dist:i" => \$dist_mi );
if ( $angle_deg < 0 or $dist_mi < 0 ) {
        die "usage: $0 --angle=xx --dist=yy\n";
}

my $angle_triangle = $angle_deg/2;
my $angle_rad = deg2rad( $angle_triangle );
my $width = tan( $angle_rad ) * $dist_mi;
my $beamwidth = $width * 2;

printf "beamwidth for %d degrees at %3.1f miles is %4.2f miles\n",
        $angle_deg, $dist_mi, $beamwidth;

-- IanKluft - 07 Nov 2008
to top


You are here: SVWUX > CalculatingBeamWidth

to top

Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding SVWUX? Send feedback