from __future__ import division
import math
m=1
lamda=546*10**-9
d=0.10*10**-3 #in m
sin_theta=((m-0.5)*lamda)/(d)
print("Sin theta = %.5f"%sin_theta)
theta=math.degrees(math.asin(sin_theta))
print("Angle in degree= %.5f"%theta)
from __future__ import division
delta=546*10**-9 #in meter
D=20*10**-2 #in meter
d=0.10*10**-3 #in meter
delta_y=(delta*D)/d
print("Linear distance in meter= %.5f"%delta_y)
from __future__ import division
d=3200 #in A
n=1.33
for m in range(1,3):
lambda_max=(2*d*n)/(m+0.5)
lambda_min=(8500/m)
print("When m=",m)
print("Lambda_max=",lambda_max)
print("Lambda_min=",lambda_min)
from __future__ import division
lamda=5000 #in A
n=1.38
for m in range(0,4):
print("When m=",m)
d=((m+0.5)*lamda)/(2*n)
print("d in A=%.3f"%d)