summaryrefslogtreecommitdiff
path: root/3840/CH3/EX3.14/Ex3_14.sce
blob: c1850bcc4965d1e673e8f3ca3e34668e70c67507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
clear
//
//
//

//Variable declaration
d=3.04         //interplanar spacing(angstrom)             
lamda=0.79    //wavelength of X-rays(angstrom)
n=3

//Calculation
sintheta=n*lamda/(2*d)
theta=(5+(25/60))*%pi/180;     //glancing angle(radian)
thetad=asin(sintheta)*180/%pi            //glancing angle(degrees)
thetam=(theta-int(theta))*60                        //glancing angle(minutes)
thetas=60*(thetam-int(thetam))                  //glancing angle(seconds)

//Result
printf("\n glancing angle is %0.0f degrees %0.3f minutes %0.3f seconds",thetad,thetam,thetas)
printf("\n answer given in the book is wrong")