diffraction_single_slit(w.length = 550,
slit.width = 1e-5,
angle = 0)
# use odd number for length.out so that 0 is in the sequence
angles <- pi * seq(from = -1/2, to = 1/2, length.out = 501)
plot(angles,
diffraction_single_slit(w.length = 550, # 550 nm
slit.width = 6e-6, # 6 um
angle = angles),
type = "l",
ylab = "Relative irradiance (/1)",
xlab = "Angle (radian)")
plot(angles,
diffraction_double_slit(w.length = 550, # 550 nm
slit.width = 6e-6, # 6 um
slit.distance = 18e-6, # 18 um
angle = angles),
type = "l",
ylab = "Relative irradiance (/1)",
xlab = "Angle (radian)")
Run the code above in your browser using DataLab