from __future__ import division
from math import sin, pi, degrees, asin
n1=1
n2=1.52
x=sin(pi/180*30)
theta_2=degrees(asin((n1*x)/n2))
print "Angle = %0.2f degree"%theta_2
print "Solution a"
c=3*10**8# Constant in m/s
n=1.458
v=c/n
print "Velocity = %0.2e m/s"%v
print "Solution b"
lambda_o=589#in nm
lambda_n=lambda_o/n
print "Wavelength in Fused quartz = %0.2f nm"%lambda_n
from math import atan, degrees, asin
x=699#in micrometer(w-a)
t=1200 #in micrometer
b=x/2
theta_2=degrees(atan(b/t))
print "Angle = %0.2f degree"%theta_2
y=sin(pi/180*theta_2)
n1=1
n2=1.55
theta_1=degrees(asin((n2*y)/n1))
print "Angle = %0.2f degree"%theta_1
from math import asin, degrees
n1=1.33
n2=1
x=degrees(asin(n2/n1))
print "Angle(theta_c) = %0.2f degree"%x