#importing modules
import math
from __future__ import division
#Variable declaration
a=4;
b=2;
c=2; #intercepts
#Calculation
h=int(a/a);
k=int(a/b);
l=int(a/c); #miller indices
#Result
print "miller indices are (",h,k,l,")"
#importing modules
import math
from __future__ import division
#Variable declaration
a=6;
b=2;
c=2; #intercepts
#Calculation
h=int(a/a);
k=int(a/b);
l=int(a/c); #miller indices
#Result
print "miller indices are (",h,k,l,")"
#importing modules
import math
from __future__ import division
#Variable declaration
a=3;
b=3;
c=3; #intercepts
#Calculation
h=int(c/a);
k=int(c/b);
l=int(c/c); #miller indices
#Result
print "miller indices are (",h,k,l,")"
#importing modules
import math
from __future__ import division
#Variable declaration
a=2;
b=3;
c=6; #intercepts
#Calculation
h=int(c/a);
k=int(c/b);
l=int(c/c); #miller indices
#Result
print "miller indices are (",h,k,l,")"
#importing modules
import math
from __future__ import division
#Variable declaration
a=0.212;
b=1;
c=0.183; #intercepts
ac=0.424;
bc=1;
cc=0.366; #axial units
#Calculation
h=int(ac/a);
k=int(bc/b);
l=int(cc/c); #miller indices
#Result
print "miller indices are (",h,k,l,")"
#importing modules
import math
from __future__ import division
#Variable declaration
h=2;
k=3;
l=1; #intercepts
a=1.2;
b=1.8;
c=2; #primitives(angstrom)
p=1.2; #intercept along X-direction
#Calculation
q=b/k;
r=2*p/q;
#Result
print "intercepts along x,y,z directions are",p,"angstrom",2*q,"angstrom",r,"angstrom"
#importing modules
import math
from __future__ import division
from sympy import Symbol
#Variable declaration
a=Symbol('a');
h1=1;
k1=0;
l1=0; #intercepts of 1st plane
h2=1;
k2=1;
l2=0; #intercepts of 2nd plane
h3=1;
k3=1;
l3=1; #intercepts of 3rd plane
#Calculation
d100=a/math.sqrt(h1**2+k1**2+l1**2); #interplanar separation for 1st plane
d110=a/math.sqrt(h2**2+k2**2+l2**2); #interplanar separation for 2nd plane
d111=a/math.sqrt(h3**2+k3**2+l3**2); #interplanar separation for 3rd plane
#Result
print "interplanar separation for 1st plane is",d100
print "interplanar separation for 2nd plane is",round(d110/a,3),"*a"
print "interplanar separation for 3rd plane is",round(d111/a,3),"*a"
#importing modules
import math
from __future__ import division
#Variable declaration
h=3;
k=4;
l=5; #miller indices
a=2;
b=2;
c=1; #parameters
#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2)); #interplanar separation(angstrom)
#Result
print "interplanar separation is",round(d,3),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
a=6; #lattice parameter(angstrom)
h=1;
k=1;
l=1; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
#Result
print "interplanar distance is",round(d,3),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
a=6.3; #lattice parameter(angstrom)
h=2;
k=2;
l=1; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
#Result
print "interplanar distance is",round(d,1),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
a=5; #lattice parameter(angstrom)
h=4;
k=3;
l=0; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
#Result
print "interplanar distance is",int(d),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
h=1;
k=2;
l=3; #miller indices
#Calculation
p=int(k*l/h);
q=int(k*l/k);
r=int(k*l/l); #ratio of intercepts on axes
#Result
print "ratio of intercepts on axes is",p,":",q,":",r
#importing modules
import math
from __future__ import division
#Variable declaration
a=4.2*10**-10; #lattice parameter(m)
h=3;
k=2;
l=1; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(m)
#Result
print "interplanar distance is",round(d*10**10,2),"*10**-10 m"
#importing modules
import math
from __future__ import division
#Variable declaration
h=1;
k=1;
l=1; #miller indices
a=2.5;
b=2.5;
c=1.8; #parameters
#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2)); #interplanar separation(angstrom)
#Result
print "interplanar separation is",round(d,2),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
r=1.744; #atomic radius(angstrom)
h1=2;
k1=0;
l1=0; #intercepts of 1st plane
h2=2;
k2=2;
l2=0; #intercepts of 2nd plane
h3=1;
k3=1;
l3=1; #intercepts of 3rd plane
#Calculation
a=4*r/math.sqrt(2);
d200=a/math.sqrt(h1**2+k1**2+l1**2); #interplanar separation for 1st plane(angstrom)
d220=a/math.sqrt(h2**2+k2**2+l2**2); #interplanar separation for 2nd plane(angstrom)
d111=a/math.sqrt(h3**2+k3**2+l3**2); #interplanar separation for 3rd plane(angstrom)
#Result
print "interplanar separation for 1st plane is",round(d200,3),"angstrom"
print "interplanar separation for 2nd plane is",round(d220,2),"angstrom"
print "interplanar separation for 3rd plane is",round(d111,2),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
h1=1;
k1=1;
l1=1; #intercepts of 1st plane
h2=1;
k2=1;
l2=0; #intercepts of 2nd plane
a=1;
#Calculation
d111=a/math.sqrt(h1**2+k1**2+l1**2); #interplanar separation for 1st plane(angstrom)
d110=a/math.sqrt(h2**2+k2**2+l2**2); #interplanar separation for 2nd plane(angstrom)
#Result
print "ratio of densities is",round(1/d110,3),":",round(1/d111,3)
#importing modules
import math
from __future__ import division
#Variable declaration
a=2.814; #lattice parameter(m)
h=1;
lamda=0.71; #wavelength(angstrom)
k=0;
l=0; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
theta=math.asin(lamda/d); #glancing angle(radian)
theta=theta*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle is",round(theta,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
a=4.5; #lattice parameter(m)
h=2;
k=2;
theta=30*math.pi/180; #angle(radian)
l=1; #miller indices
n=2;
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
lamda=2*d*math.sin(theta); #wavelength(angstrom)
theta=math.asin(lamda/d); #glancing angle(radian)
theta=theta*180/math.pi; #glancing angle(degrees)
#Result
print "wavelength is",lamda,"angstrom"
print "glancing angle is",round(theta,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
theta=(8+(35/60))*math.pi/180; #angle(radian)
n2=2;
n3=3;
d=2.82*10**-10; #lattice spacing(m)
#Calculation
lamda=2*d*math.sin(theta); #wavelength(m)
theta2=math.asin(n2*lamda/(2*d)); #glancing angle(radian)
theta2=theta2*180/math.pi; #glancing angle(degrees)
theta3=math.asin(n3*lamda/(2*d)); #glancing angle(radian)
theta3=theta3*180/math.pi; #glancing angle(degrees)
#Result
print "wavelength is",round(lamda*10**10,3),"*10**-10 m"
print "glancing angle for second order is",round(theta2,2),"degrees"
print "glancing angle for third order is",round(theta3,1),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
a=5; #lattice parameter(angstrom)
h=3;
lamda=0.5; #wavelength(angstrom)
k=4;
n=2;
l=0; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
theta1=math.asin(lamda/(2*d)); #glancing angle(radian)
theta1=theta1*180/math.pi; #glancing angle(degrees)
theta2=math.asin(2*lamda/(2*d)); #glancing angle(radian)
theta2=theta2*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 1st order is",theta2,"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
a=3; #lattice parameter(angstrom)
h=1;
k=1;
n=1;
l=1; #miller indices
theta=45*math.pi/180; #angle(radian)
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
lamda=2*d*math.sin(theta); #wavelength(angstrom)
#Result
print "wavelength is",round(lamda,2),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1.5; #wavelength(angstrom)
d=2; #seperation(angstrom)
n=2;
#Calculation
theta1=math.asin(lamda/(2*d)); #glancing angle(radian)
theta1=theta1*180/math.pi; #glancing angle(degrees)
theta2=math.asin(n*lamda/(2*d)); #glancing angle(radian)
theta2=theta2*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 2nd order is",round(theta2,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1.25; #wavelength(angstrom)
theta=45*math.pi/180; #angle(radian)
n=1;
#Calculation
d=n*lamda/(2*math.sin(theta)); #interplanar separation(angstrom)
#Result
print "interplanar separation is",round(d,2),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1; #wavelength(angstrom)
d=5; #seperation(angstrom)
n1=1;
n2=2;
n3=3;
n4=4; #order
#Calculation
theta1=math.asin(n1*lamda/(2*d)); #glancing angle(radian)
theta1=theta1*180/math.pi; #glancing angle(degrees)
theta2=math.asin(n2*lamda/(2*d)); #glancing angle(radian)
theta2=theta2*180/math.pi; #glancing angle(degrees)
theta3=math.asin(n3*lamda/(2*d)); #glancing angle(radian)
theta3=theta3*180/math.pi; #glancing angle(degrees)
theta4=math.asin(n4*lamda/(2*d)); #glancing angle(radian)
theta4=theta4*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle for 1st order is",round(theta1,2),"degrees"
print "glancing angle for 2nd order is",round(theta2,2),"degrees"
print "glancing angle for 1st order is",round(theta3,2),"degrees"
print "glancing angle for 2nd order is",round(theta4,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
theta=30*math.pi/180; #angle(radian)
#assume that sin(theta)=x
x1=1;
x2=2;
x3=3;
x4=4;
#Calculation
theta1=math.asin(x1*math.sin(theta)/x4); #1st bragg reflection angle(radian)
theta1=theta1*180/math.pi; #1st bragg reflection angle(degrees)
theta2=math.asin(x2*math.sin(theta)/x4); #1st bragg reflection angle(radian)
theta2=theta2*180/math.pi; #1st bragg reflection angle(degrees)
theta3=math.asin(x3*math.sin(theta)/x4); #1st bragg reflection angle(radian)
theta3=theta3*180/math.pi; #1st bragg reflection angle(degrees)
#Result
print "1st bragg reflection angle is",round(theta1,2),"degrees"
print "2nd bragg reflection angle is",round(theta2,2),"degrees"
print "3rd bragg reflection angle is",round(theta3,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1.25; #wavelength(angstrom)
d=2.5; #seperation(angstrom)
#Calculation
n=2*d/lamda; #maximum order of bragg reflection
#Result
print "maximum order of bragg reflection is",int(n)
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1.5; #wavelength(angstrom)
d=2.8; #seperation(angstrom)
#Calculation
n=2*d/lamda; #maximum order of bragg reflection
#Result
print "maximum order of bragg reflection is",int(n)
#importing modules
import math
from __future__ import division
#Variable declaration
theta1=15*math.pi/180; #angle(radian)
theta2=16*math.pi/180; #angle(radian)
d=2.8; #lattice spacing(angstrom)
#Calculation
lamda1=2*d*math.sin(theta1); #wavelength for 1st angle(angstrom)
lamda2=2*d*math.sin(theta2); #wavelength for 2nd angle(angstrom)
#Result
print "wavelength for 1st angle is",round(lamda1,2),"angstrom"
print "wavelength for 2nd angleis",round(lamda2,3),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
x=1;
y=3;
z=-2;
#Calculation
h=-y*z/x;
k=-y*z/y;
l=y*z/z; #miller indices
#Result
print "miller indices are (",int(h),int(k),int(l),")"
#importing modules
import math
from __future__ import division
#Variable declaration
h=1;
k=1;
l=1; #miller indices
a=2.5;
b=2.5;
c=1.8; #parameters
#Calculation
d=1/math.sqrt((h**2/a**2)+(k**2/b**2)+(l**2/c**2)); #interplanar separation(angstrom)
#Result
print "interplanar separation is",round(d,2),"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
a=2.814; #lattice parameter(m)
h=1;
lamda=0.78; #wavelength(angstrom)
k=0;
l=0; #miller indices
#Calculation
d=a/math.sqrt(h**2+k**2+l**2); #interplanar distance(angstrom)
theta=math.asin(lamda/d); #glancing angle(radian)
theta=theta*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle is",round(theta,1),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1;
n2=2;
d=2.82; #seperation(angstrom)
#Calculation
lamda_max1=2*d/n1; #longest wavelength in 1st order(angstrom)
lamda_max2=2*d/n2; #longest wavelength in 2nd order(angstrom)
#Result
print "longest wavelength in 1st order is",lamda_max1,"angstrom"
print "longest wavelength in 2nd order is",lamda_max2,"angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
theta=(8+(35/60))*math.pi/180; #angle(radian)
n1=1;
n2=2;
n3=3;
d=2.82*10**-10; #lattice spacing(m)
#Calculation
lamda=2*d*math.sin(theta)/n1; #wavelength(m)
theta2=math.asin(n2*lamda/(2*d)); #glancing angle(radian)
theta2=theta2*180/math.pi; #glancing angle(degrees)
theta2_m=60*(theta2-int(theta2));
theta3=math.asin(n3*lamda/(2*d)); #glancing angle(radian)
theta3=theta3*180/math.pi; #glancing angle(degrees)
theta3_m=60*(theta3-int(theta3));
#Result
print "wavelength is",round(lamda*10**10,3),"angstrom"
print "glancing angle for second order is",int(theta2),"degrees",int(theta2_m),"minutes"
print "glancing angle for third order is",int(theta3),"degrees",round(theta3_m),"minutes"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=0.071*10**-9; #wavelength(angstrom)
d100=0.28*10**-9; #seperation(angstrom)
n=2;
#Calculation
d110=d100/math.sqrt(2);
theta=math.asin(n*lamda/(2*d110))*180/math.pi; #glancing angle(degrees)
#Result
print "glancing angle is",int(theta),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
theta=(8+(35/60))*math.pi/180; #angle(radian)
n=1;
d=0.282; #lattice spacing(nm)
#Calculation
lamda=2*d*math.sin(theta)/n; #wavelength(nm)
n_max=2*d/lamda; #maximum order of diffraction
#Result
print "wavelength is",round(lamda,4),"nm"
print "maximum order of diffraction is",int(n_max)
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1.5418*10**-10; #wavelength(m)
theta=30*math.pi/180; #angle(radian)
n=1;
h=1;
k=1;
l=1;
#Calculation
d=n*lamda/(2*math.sin(theta)); #interplanar separation(m)
a=d*math.sqrt(h**2+k**2+l**2); #interatomic spacing(m)
#Result
print "interatomic spacing is",round(a*10**10,2),"*10**-10 m"