from __future__ import division
from math import log10
D=2 #m(Diameter)
f=6000 #MHz(Frequency)
c=3*10**8 #m/s##speed of light
lamda=c/(f*10**6) #m(Wavelength)
FNBW=140*lamda/D #degree
print "First null beam width, FNBW = %0.1f degree "%FNBW
GP=6*(D/lamda)**2 #unitless(Power gain)
GP_dB=10*log10(GP) #dB(Power gain)
print "Power Gain = %0.2f dB"%GP_dB
#Ans in the book is not accurate.
from math import log10, sqrt
GP=1000 #unitless(Power gain)
lamda=10 #cm(Wavelength)
D=sqrt(GP/6)*(lamda/100) #m(Diameter)
print "Diameter of mouth = %0.2f meter" %D
HPBW=58*(lamda/100)/D #degree(HPBW)
print "Half power beam width, HPBW = %0.2f degree"%HPBW
from math import log10, sqrt, pi
D=6 #meter(Diameter)
f=10 #GHz(Frequency)
c=3*10**8 #m/s##speed of light
lamda=c/(f*10**9) #m(Wavelength)
GP=6*(D/lamda)**2 #unitless(Power gain)
GP_dB=10*log10(GP) #dB(Power gain)
print "Gain = %0.2f dB "%GP_dB
FNBW=140*lamda/D #degree(FNBW)
print "FNBW = %0.2f degree "%FNBW
HPBW=58*lamda/D #degree(HPBW)
print "HPBW = %0.2f degree "%HPBW
K=0.65 #constant
Ao=K*pi/4*D**2 #m²(Capture area)
print "Capture area = %0.2f m² "%Ao