Learn R Programming

photobiology (version 0.10.6)

diffraction_single_slit: Diffraction

Description

Diffraction of optical radiation passing through a single slit can be computed with function diffraction_single_slit(), which implements Fraunhofer's equation. Diffraction plus interference for a pair of slits can be computed with diffraction_double_slit().

Usage

diffraction_single_slit(w.length, slit.width, angle)

diffraction_double_slit(w.length, slit.width, slit.distance, angle)

Arguments

w.length

numeric Wavelength (nm).

slit.width

numeric Width of the slit (m).

angle

numeric vector Angle (radians).

slit.distance

numeric Distance between the centres of the two slits (m).

Value

A numeric vector of the same length as angle, containing relative intensities.

Examples

Run this code
# NOT RUN {
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