<html>
<head>
<title>Moxon Rectangle Calculator</title>
</head>
<body bgcolor=#000088 text=#ffcc00 link=#ffcc00 alink=#ff6600 vlink=#dd9900>
Program to calculate the dimentions of a Moxon Rectangle.<br>
<br>
All equations correlated to NEC antenna modeling software for wire
diameters from 1e-5 to 1e-2 wavelengths.<br>
<br>
Original BASIC program by L.B. Cebik W4RNL<br>
<a href="moxon2.c">C</a> and <a href="moxon.phps">PHP4</a> port by Rich Alloway N3WWN<br>
<br>

<form action="<?=$_SERVER['PHP_SELF'];?>" method=post>

<?php
    
if( $_SERVER["REQUEST_METHOD"] == "POST" ) {
        
$f = $_REQUEST['f'];
        
$wd = $_REQUEST['wd'];
        
$u = $_REQUEST['u'];
    }
?>

Frequency: <input type=text name=f value=<?=$f?>> MHz<br>
Wire Diameter: <input type=text name=wd value=<?=$wd?>>
<span style="color: #000000">
<select name=u>
<option value=1 <?php if( $u == 1) print "SELECTED";?>>Inches
<option value=2 <?php if( $u == 2) print "SELECTED";?>>Millimeters
<option value=3 <?php if( $u == 3) print "SELECTED";?>>Wavelengths
</select><br>
<input type=submit><input type=reset>
</span>
</form>

<img src="moxon.jpg"><br><br>

<?php
if( isset( $f )) {
    if(
$u == 1 ) {
        
$wli = 11802.71 / $f;
        
$dw = $wd / $wli;
    }
    if(
$u == 2 ) {
        
$wli = 299792.5 / $f;
        
$dw = $wd / $wli;
    }
    if(
$u == 3 ) {
        
$dw = $wd;
    }

    print
"Wire Diameter in Wavelenghts: $dw<br><br>";

    
$d1 = 0.4342945 * log( $dw );
    if(
$d1 < -6 )
        print
"Wire diameter less than 1e-6 wavelengths: results uncertain!<br><br>";
    if(
$d1 > -2 )
        print
"Wire diameter greater than 1e-2 wavelengths: results uncertain!<br><br>";

    
$aa = -0.0008571428571;
    
$ab = -0.009571428571;
    
$ac = 0.3398571429;
    
$a = ( $aa * pow( $d1, 2 )) + ( $ab * $d1 ) + $ac;

    
$ba = -0.002142857143;
    
$bb = -0.02035714286;
    
$bc = 0.008285714286;
    
$b = ( $ba * pow( $d1, 2 )) + ( $bb * $d1 ) + $bc;

    
$ca = 0.001809523381;
    
$cb = 0.01780952381;
    
$cc = 0.05164285714;
    
$c = ( $ca * pow( $d1, 2 )) + ( $cb * $d1 ) + $cc;

    
$da = 0.001;
    
$db = 0.07178571429;
    
$d = ( $da * $d1 ) + $db;
    
$e = $b + $c + $d;

    
printf( "Moxon Dimensions in Wavelengths:<br><br>" );
    
printf( "A = %.4f WL<br>", $a );
    
printf( "B = %.4f WL<br>", $b );
    
printf( "C = %.4f WL<br>", $c );
    
printf( "D = %.4f WL<br>", $d );
    
printf( "E = %.4f WL<br><br>", $e );

    
$wf = 983.5592 / $f;
    
$wfi = $wf * 12;

    
printf( "Wavelength = %.4f Feet or %.4f Inches<br><br>", $wf, $wfi );
    
printf( "Dimensions in Feet and Inches<br><br>" );
    
printf( "A = %.4f Feet or %.4f Inches<br>", $a * $wf, $a * $wfi );
    
printf( "B = %.4f Feet or %.4f Inches<br>", $b * $wf, $b * $wfi );
    
printf( "C = %.4f Feet or %.4f Inches<br>", $c * $wf, $c * $wfi );
    
printf( "D = %.4f Feet or %.4f Inches<br>", $d * $wf, $d * $wfi );
    
printf( "E = %.4f Feet or %.4f Inches<br>", $e * $wf, $e * $wfi );


}

?>

</body>
<!--?=phpinfo()?-->
</html>