import math
#to calculate area of the spot on the moon
lamda=6*10**-7 #wavelength in m
d=2 #diameter in m
dtheta=lamda/d #angular spread in radian
D=4*10**8 #distance of the moon
A=(D*dtheta)**2
print "the areal spread is A=","{:.2e}".format(A),"m**2"
import math
#to calculate angular spread of the beam
lamda=8*10**-7 #wavelength in m
d=5*10**-3 #aperture in m
dtheta=lamda/d
print "the angular spread of the beam is dtheta=","{:.1e}".format(dtheta),"radian"
#to calculate the areal spread when it reaches the moon
D=4*10**8 #distance of the moon in m
A=(D*dtheta)**2
print "the areal spread is A=","{:.3e}".format(A),"m**2"
import math
#to calculate number of oscillations corresponding to the coherence length
L=2.945*10**-2 #coherence length in m
lamda=5890*10**-10 #wavelength of sodium light in m
n=L/lamda
print "the number of oscillations is n=","{:.1e}".format(n),"unitless"
#to calculate coherence time
c=3*10**8 #light speed in m
Time=L/c #coherence time
print "the coherence Time=","{:.2e}".format(Time),"s"
import math
#to calculate area and intensity of the image
lamda=7200*10**-10 #wavelength in m
d=5*10**-3 #aperture in m
dtheta=lamda/d #angular spread in radian
f=0.1 #focal length in m
arealspread=(dtheta*f)**2
print "areal spread =","{:.3e}".format(arealspread),"m**2"
power=50*10**-3
I=power/arealspread
print "intensity of the image is I=","{:.3e}".format(I),"watts/m**2"