summaryrefslogtreecommitdiff
path: root/2258/CH1/EX1.21/1_21.sce
blob: fe539cda32aa53059909a5016d0f752167b55445 (plain)
1
2
3
4
5
6
7
8
9
clc();
clear;
// To calculate the spacing of the crystal
V=344;   //accelerated voltage in V
n=1;    //first reflection
theta=60;   //glancing angle in degrees
lamda=12.27/sqrt(V);
d=(n*lamda)/(2*sind(theta));
printf("The spacing of the crystal is %f Angstrom",d);