MiscFunction.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:RefractiveIndex-Importer 作者: gr4ph0s 项目源码 文件源码
def IOR(self,n,k):
        theta_deg = 0
        fresnel = []

        while theta_deg <= 90:
            theta = math.radians(theta_deg)
            a = math.sqrt((math.sqrt((n**2-k**2-(math.sin(theta))**2)**2 + ((4 * n**2) * k**2)) + (n**2 - k**2 - (math.sin(theta))**2))/2)
            b = math.sqrt((math.sqrt((n**2-k**2-(math.sin(theta))**2)**2 + ((4 * n**2) * k**2)) - (n**2 - k**2 - (math.sin(theta))**2))/2)

            Fs = (a**2+b**2-(2 * a * math.cos(theta))+(math.cos(theta))**2)/(a**2+b**2+(2 * a * math.cos(theta))+(math.cos(theta))**2)
            Fp = Fs * ((a**2+b**2-(2 * a * math.sin(theta) * math.tan(theta))+(math.sin(theta))**2*(math.tan(theta))**2)/(a**2+b**2+(2 * a * math.sin(theta) * math.tan(theta))+(math.sin(theta))**2*(math.tan(theta))**2))

            R = (Fs + Fp)/2
            fresnel.append(R)
            theta_deg += 1
        return fresnel
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号