1 #ifdef HAVE_STDLIB_H 2 #include <stdlib.h> 3 #endif 4 #include <stdio.h> 5 #include <math.h> 6 7 #include <errno.h> 8 #include "yagi.h" 9 #include <errno.h> 10 11 12 /* We calculate the vswr, given the magnitude of the reflection 13 coefficient */ calculate_vswr(double magnitude)14double calculate_vswr(double magnitude) 15 { 16 double swr; 17 if(magnitude > 0.98 ) 18 magnitude=0.98; 19 swr=(1+magnitude)/(1-magnitude); 20 #ifdef DEBUG 21 if(errno) 22 { 23 fprintf(stderr,"Errno =%d in vswr.c\n", errno); 24 exit(1); 25 } 26 #endif 27 return(swr); 28 } 29