import math
##Example 7.1
##plane parallel thin film
##given values
x=5890*10**-10;##wavelength of light in metre
n=1.5;##refractive index
r=60*math.pi/180.;##angle of refraction in degree
##calculation
t=x/(2*n*math.cos(r));
print'%s %.2f %s'%('thickness of plate (in micrometre) is:',t*10**6,'');
import math
##Example 7.2
##wedge shaped thin film
##given values
x=5893*10**-10.;##wavelength of light in metre
n=1.5;##refractive index
y=.1*10**-3.;##fringe spacing
##calculation
z=x/(2.*n*y);##angle of wedge
alpha=z*180./math.pi;##conversion of radian into degree
print'%s %.2f %s'%('angle of wedge (in degree) is:',alpha,'');
import math
##Example 7.3
##Newton's ring experiment- calculation of refractive index
##given values
D1=1.5;##diametre (in cm)of tenth dark ring in air
D2=1.27;##diametre (in cm)of tenth dark ring in liquid
##calculation
n=D1**2./D2**2.;
print'%s %.2f %s'%('refractive index of liquid is',n,'');
import math
##Example 7.4
##nonreflecting film
##given values
l=5500*10**-10.;##wavelength of light
n1=1.33;##refractive index of water
n2=1.52;##refractive index of glass window pane
x=math.sqrt(n1);##to check if it is nonreflecting
##calculation
t=l/(4.*n1);##thickness of water film required
print'%s %.2f %s'%('minimum thickness of film (in metre) is',t*10**6,'');