~ubuntu-branches/ubuntu/precise/yagiuda/precise

« back to all changes in this revision

Viewing changes to src/dipole.c

  • Committer: Bazaar Package Importer
  • Author(s): Joop Stakenborg
  • Date: 2005-08-22 20:20:13 UTC
  • Revision ID: james.westby@ubuntu.com-20050822202013-mhhxp4xirdxrdfx1
Tags: upstream-1.19
ImportĀ upstreamĀ versionĀ 1.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_STDLIB_H
 
2
#include <stdlib.h>
 
3
#endif
 
4
#include <stdio.h>
 
5
#include <math.h>
 
6
#include "yagi.h"
 
7
 
 
8
int main(int argc, char **argv)
 
9
{
 
10
   double freq, r, x, real, length, lambda, dia;
 
11
   if (argc != 4) {
 
12
     fprintf(stderr,"Usage: frequency(MHz) length(m) diamater(mm)\n");
 
13
     exit(1);
 
14
     }
 
15
   freq=atof(argv[1]);
 
16
   length=atof(argv[2]);
 
17
   dia=atof(argv[3]); 
 
18
 
 
19
   r=dia/2000;
 
20
   lambda=300/freq;
 
21
 
 
22
   self(r, length, lambda, &real, &x);
 
23
   printf("Self impedance of a dipole:\n");
 
24
   printf("%f MHz,  length %f m, diameter %f mm, is \n",freq,length,dia);
 
25
   printf("Z = %f  %+f jX Ohms\n", real,x);
 
26
   exit(0);
 
27
}