Description Usage Arguments Details Value References See Also Examples
View source: R/snell_fresnel.R
The function calculates the (complex) angle of refraction for eletromagnetic radiation transmitted to a medium.
1 | snell(thetai, ni, nr)
|
thetai |
Incidence angle relative to the normal of the interface between the two mediums (radians). |
ni |
Refractive index of the medium of incidence (unitless). |
nr |
Refractive index of the medium of refraction (unitless). |
The angle of incidence is limited to be between 0 and pi/2. Although
the sine function is periodical and the modulus will be correct for multiples
of a given angle, this serves as a protection in case incidence angles > pi/2
are inadvertently provided. NA
s are allowed in all arguments.
The indexes of refraction may be complex numbers. If so, the function will
return the complex refraction angle. This complex refractive angle should be
passed to the fresnel
function to calculate the reflectance at the
interface with an absorptive medium. Complex refractive angles can be
converted to angles of constant phase or constant amplitude with the
appropriate function (snell_decomp
). Note that the refractive indexes
are normalized to each other internally, so if passing refractive indexes
that are already relative, one of the refractive indexes should be equal
unity. See examples.
If one of the mediums have a negative refractive index, the refracted ray will occur on the same side of the normal as the incident ray, i.e., the azimuth is rotated 180° to that of the incident ray. Since this is a special condition not occurring for hydrological optics, the functions are simplified by requiring that the refractive indexes be positive.
For real indexes of refraction, in case of incidence angle is higher than the critical angle for total internal reflection (thetai > asin(nr / ni)), the function will return a real refraction angle of pi/2, i.e., absence of refraction.
A numeric or complex vector.
Bohren, C. F.; Huffman, D. R. 1983. Absorption and Scattering of Light by Small Particles. Wiley, New York.
1 2 3 4 5 6 7 8 9 10 11 12 | # Refraction from standard dry air to average seawater at 550 nm:
snell(c(0, pi/4, pi/2), ni = 1.000278, nr = 1.342033)
# Same as before but seawater index already relative to air:
snell(c(0, pi/4, pi/2), ni = 1, nr = 1.342033 / 1.000278)
# Same as before, but reversed direction:
snell(c(0, pi/4, pi/2), ni = 1.342033 / 1.000278, nr = 1)
# Same as before, but with the complex index of refraction of water:
snell(c(0, pi/4, pi/2), ni = complex(real = 1.342033, imaginary = 2.442E-09)
/ 1.000278, nr = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.