Skip to content

Commit

Permalink
add snell_angles convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed Aug 23, 2023
1 parent 66534db commit 1109eee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions smrt/core/fresnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ def fresnel_coefficients_maezawa09_rigorous(eps_1, eps_2, mu1, full_output=False
fresnel_coefficients = fresnel_coefficients_maezawa09_rigorous


def snell_angle(eps_1, eps_2, mu1):
"""compute mu2 the cos(angle) in the second medium according to Snell's law."""

# incident wavenumber
n1 = np.sqrt(eps_1)
kiz2 = n1.real**2 * (1 - mu1**2) # this the square of kiz = n1 * sin(theta)

ktz2 = kiz2 # unnumbered equation before 22 -> tangential k is conserved throught the interface (=Snell law)
kyt = - np.sqrt(complex(eps_2) - ktz2) # Eq 8 for t

mu2 = - kyt.real / np.sqrt(eps_2).real # by definition of kyt

return mu2


def brewster_angle(eps_1, eps_2):
"""compute the brewster angle
Expand Down

0 comments on commit 1109eee

Please sign in to comment.