summaryrefslogtreecommitdiff
path: root/3537/CH4/EX4.16/Ex4_16.sce
blob: f755680f9bc84c2dd6466ac10350caafcd92bc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Example 4_16
clc();
clear;
//To find the wavelength and energy of X-ray beam
theta=27.5                         //units in degrees
n=1
h=1
k=1
l=1
H=6.625*10^-34                   //planks constant
c=3*10^10                //velocity of light units in meters
a=5.63*10^-10                     //units in meters
lemda=(2*(a/sqrt(h^2+k^2+l^2))*sin(theta*%pi/180))/n*10^10
printf("The wavelength of X-Ray beam is %.0f angstrom",lemda)
lemda=lemda*10^-10   //units in cm
E=(H*c)/lemda
E=E*10^20  //units in Joules
E=E/(1.6*10^-19)
printf("\n\nThe energy of X-ray beam is ")
disp(E)
printf("eV")