# Path: EMpy/utils.py
# def snell(theta_inc, n):
#     """Snell law.
# 
#     INPUT
#     theta_inc = angle of incidence.
#     n = 1D numpy.array of refractive indices.
# 
#     OUTPUT
#     theta = 1D numpy.array.
#     """
# 
#     theta = numpy.zeros_like(n)
#     theta[0] = theta_inc
#     for i in range(1, n.size):
#         theta[i] = numpy.arcsin(n[i - 1] / n[i] * numpy.sin(theta[i - 1]))
#     return theta
# 
# def norm(x):
#     """Return the norm of a 1D vector."""
#     return numpy.sqrt(numpy.vdot(x, x))
# 
# Path: EMpy/constants.py



from builtins import zip
from builtins import range
from builtins import object
from scipy.linalg import inv
from EMpy.utils import snell, norm
from EMpy.constants import c, mu0
import scipy as S
        radiant) wrt the normal.
        """
        TransferMatrix.__init__(self, multilayer)
        self.theta_inc_x = theta_inc_x
        self.theta_inc_y = theta_inc_y

    def solve(self, wls):
        """Anisotropic solver.

        INPUT
        wls = wavelengths to scan (any asarray-able object).

        OUTPUT
        self.R, self.T = power reflected and transmitted.
        """

        self.wls = S.asarray(wls)

        multilayer = self.multilayer
        theta_inc_x = self.theta_inc_x
        theta_inc_y = self.theta_inc_y

        def find_roots(wl, epsilon, alpha, beta):
            """Find roots of characteristic equation.

            Given a wavelength, a 3x3 tensor epsilon and the tangential components
            of the wavevector k = (alpha,beta,gamma_i), returns the 4 possible
            gamma_i, i = 1,2,3,4 that satisfy the boundary conditions.
            """


# Path: EMpy/utils.py
# def snell(theta_inc, n):
#     """Snell law.
# 
#     INPUT
#     theta_inc = angle of incidence.
#     n = 1D numpy.array of refractive indices.
# 
#     OUTPUT
#     theta = 1D numpy.array.
#     """
# 
#     theta = numpy.zeros_like(n)
#     theta[0] = theta_inc
#     for i in range(1, n.size):
#         theta[i] = numpy.arcsin(n[i - 1] / n[i] * numpy.sin(theta[i - 1]))
#     return theta
# 
# def norm(x):
#     """Return the norm of a 1D vector."""
#     return numpy.sqrt(numpy.vdot(x, x))
# 
# Path: EMpy/constants.py



# Path: EMpy/transfer_matrix.py
from builtins import zip
from builtins import range
from builtins import object
from scipy.linalg import inv
from EMpy.utils import snell, norm
from EMpy.constants import c, mu0
import scipy as S

        radiant) wrt the normal.
        """
        TransferMatrix.__init__(self, multilayer)
        self.theta_inc_x = theta_inc_x
        self.theta_inc_y = theta_inc_y

    def solve(self, wls):
        """Anisotropic solver.

        INPUT
        wls = wavelengths to scan (any asarray-able object).

        OUTPUT
        self.R, self.T = power reflected and transmitted.
        """

        self.wls = S.asarray(wls)

        multilayer = self.multilayer
        theta_inc_x = self.theta_inc_x
        theta_inc_y = self.theta_inc_y

        def find_roots(wl, epsilon, alpha, beta):
            """Find roots of characteristic equation.

            Given a wavelength, a 3x3 tensor epsilon and the tangential components
            of the wavevector k = (alpha,beta,gamma_i), returns the 4 possible
            gamma_i, i = 1,2,3,4 that satisfy the boundary conditions.
            """


            omega = 2.0 * S.pi * c / wl