import math;
# Variable Declaration
# d = lamda/2
theta_d = 5 # angle blw los and perpendicular bisector of line joining two antennas
# Calculations
#PD = (2*%pi/lamda)*(d*sin(theta));
#PD = (2*%pi/lamda)*(lamda/2*sin(theta));
theta_r = theta_d*(math.pi/180)
PD_r = (2*math.pi)*((math.sin(theta_r))/2); # phase difference in radians
PD_d = PD_r*(180/math.pi); # phase difference in radians
# Result
print 'Phase difference b/w two echo signals is %0.2f'%(PD_d),'degrees'," OR %0.2f " %PD_r,'radians';
# import math
# Variable Declaration
F = 1*10**9; # operating frequency of monopulse radar in Hz
Vo = float(3*10**8); # velocity of EM wave in m/s
theta_d = 10 # angle blw los and perpendicular bisector of line joining two antennas
PD_d = 20; # phase difference in degrees
# Calculations
lamda = Vo/F # wavelength in m
# PD = (2*%pi/lamda)*(d*sin(theta));
theta_r = theta_d*(math.pi/180) # degree to radian conversion
PD_r = PD_d*(math.pi/180) # degree to radian conversion
d = (PD_r*lamda)/(2*math.pi*math.sin(theta_r));
# Output
print 'Spacing between the antennas is %0.2f'%(d*100),'Cms';