summaryrefslogtreecommitdiff
path: root/3651/CH2/EX2.12/Ex2_12.sce
blob: 4a050e2815c7ca77d87c3044c550278aa27d4ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
clc
//Variable declaration
a=3.16
lamda=1.54
n=1
theta=20.3*%pi/180

//Calculations
d=(n*lamda)/(2*sin(theta))
x=a/d                             //let sqrt(h**2+k**2+l**2)=x

//Result
printf('d =%0.3f Angstorms\n',(d))
printf('sqrt(h**2+k**2+l**2) =%0.3f \n',(x))
printf('Therefore, h**2+k**2+l**2 =sqrt(2)\n')
printf('h =1, k=1')