summaryrefslogtreecommitdiff
path: root/2309/CH5/EX5.4/Ex5_4.sce
blob: c5e8434f5e1a696c58aaa576b7dffc7da9dd39a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Chapter 5 Example 4
//==============================================================================
clc;
clear;

//input data
lamda   = 1.5418;       // wavelength in Å
h       = 1;            // miller indice
k       = 1;            // miller indice
l       = 1;            // miller indice
n       = 1;            // given first order
theta   = 30;           // diffraction angle in degrees

// Calculations
theta1   = theta*%pi/180;   // degree to radian conversion
// d     = (n*lamda)/(2*sinθ);    by Braggs law               ------------- 1
// d     = a/sqrt((h^2)+(k^2)+(l^2));  interplanar distance    ------------ 2
// equating 1 and 2

a       = (n*lamda*sqrt((h^2)+(k^2)+(l^2))/(2*sin(theta1)))

// Output
mprintf('Interatomic spacing a = %f Å',a);
//==============================================================================