summaryrefslogtreecommitdiff
path: root/3869/CH7/EX7.15/Ex7_15.sce
blob: 66bb99e341fb8b44294bd3ee955fc03c281ba90f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clear
//
//
//

//Variable declaration
theta=45*%pi/180       //glancing angle(radian)
d=275            //interplanar spacing(pm)
n1=3
n2=4

//Calculation
lamda=2*d*sin(theta)     //wavelength(pm)
lamda1=lamda/n1               //wavelength for n=3
lamda2=lamda/n2               //wavelength for n=4

//Result
printf("\n wavelength for n=3 is %0.0f pm and for n=4 is %0.2f pm",lamda1,lamda2)
printf("\n answer for wavelength for n=4 given in the book varies due to rounding off errors")