#importing module
import math
from __future__ import division
#Variable declaration
n1=1.5 #core refractive index
n2=1.47 #clad refractive index
#Calculations
thetac=math.asin(n2/n1)
NA=(n1**2-n2**2)**0.5
im=math.asin(NA)
#Result
print"Critical angle= %2.2f" %math.degrees(thetac),"degrees"
print"numerical aperture= %1.3f" %NA
print"acceptance angle= %2.3f" %math.degrees(im),"degrees"
#importing module
import math
from __future__ import division
#Variable declaration
n1=1.6 #core refractive index
NA=0.2 #Numerical aperture
#Calculations
NA=(n1**2-NA**2)**0.5
#Result
print"refractive index of cladding= %1.3f" %NA
#importing module
import math
from __future__ import division
#Variable declaration
n1=1.6 #core refractive index
n2=1.58 #clad refractive index
#Calculations
NA=(n1**2-n2**2)**0.5
im=math.asin(NA)
#Result
print"numerical aperture= %1.3f" %NA
print"Acceptance angle= %2.2f" %math.degrees(im),"degrees" #The answer in the textbook is mathematically incorrect
#importing module
import math
from __future__ import division
#Variable declaration
delr=12*10**-3 #fractional refractive index change
NA=0.22 #Numerical aperture
#Calculations
n1=NA/math.sqrt(2*delr)
n2=n1-(n1*delr)
#Result
print"refractive index of core material= %1.2f" %n1
print"refractive index of cladding material= %1.2f" %n2
#importing module
import math
from __future__ import division
#Variable declaration
NA=0.2 #Numerical aperture
n0=1.33 #refractive index
n2=1.59 #clad refractive index
#Calculations
n1=math.sqrt(NA**2+n2**2)
NA1=math.sqrt(n1**2-n2**2)/n0
thetac=math.asin(NA1)
#Result
print"acceptance angle= %1.1f" %math.degrees(thetac),"degrees"