blob: cfcad0e52f9ca5da6d4f5805da83b67372f25dee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
clear
//
//
//
//Variable declaration
lamda=0.071*10**-9 //wavelength(m)
h=1
k=1
l=0 //miller indices
a=0.28*10**-9 //lattice constant(m)
n=2 //order
//Calculation
d=a/sqrt(h**2+k**2+l**2)
theta=asin(n*lamda/(2*d))*180/%pi //glancing angle(degrees)
//Result
printf("\n glancing angle is %0.2f degrees",theta)
|