forked from PMarzahn/sense
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrho_diff .py
More file actions
39 lines (27 loc) · 842 Bytes
/
rho_diff .py
File metadata and controls
39 lines (27 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 8 15:34:04 2017
@author: bmueller
"""
import numpy as np
eps1 = 1.
eps2 = 3.-0.j
theta1 = np.pi/6
#from ReflTransm
sin_theta2 = np.sqrt(eps1)/np.sqrt(eps2)*np.sin(theta1)
cos_theta2 = np.sqrt(1 - sin_theta2**2)
rhoh = (np.sqrt(eps1)*np.cos(theta1)-np.sqrt(eps2)*cos_theta2) / \
(np.sqrt(eps1)*np.cos(theta1) + np.sqrt(eps2)*cos_theta2)
rhov = (np.sqrt(eps1)*cos_theta2-np.sqrt(eps2)*np.cos(theta1)) / \
(np.sqrt(eps1)*cos_theta2 + np.sqrt(eps2)*np.cos(theta1))
print(rhoh)
print(rhov)
#from Prism1
n1 = np.sqrt(eps1)
n2 = np.sqrt(eps2)
costh2 = np.sqrt(1 - (n1*np.sin(theta1)/n2)**2)
rho_v = -(n2*np.cos(theta1) - n1*costh2)/(n2*np.cos(theta1)+n1*costh2)
rho_h = (n1*np.cos(theta1) - n2*costh2)/(n1*np.cos(theta1)+n2*costh2)
print(rho_h)
print(rho_v)