summaryrefslogtreecommitdiff
path: root/2780/CH8/EX8.5/Ex8_5.sce
blob: fc099e7e7ec58723e341266051571d8bdc4a8b63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
clc
//to calculate spacing of the crystal
h=6.62*10^-34 //planck's constant in J-s
m=9.1*10^-31 //mass of electron in kg
V=344 //voltage in V
e=1.6*10^-19
lambda=h/sqrt(2*m*e*V) //wavelength in m
//according to Bragg's law
n=1
//formula is 2*d*sintheta=n*lambda
d=n*lambda/(2*sin(%pi/6))
disp("the spacing of the crystal is d="+string(d)+"m")