blob: 5f1817e51daeee5a34d183595ce1d1968dea7327 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//Example number 7.12, Page number 7.18
clc;clear;close
// Variable declaration
a=3.16 // in m
lamda=1.54 // in m
n=1// unitless
theta=20.3*%pi/180 // radian
// Calculations
d=(n*lamda)/(2*sin(theta)) // in m
x=a/d // let sqrt(h^2+k^2+l^2)=x
// Result
printf("d = %.2f Angstrom",d)
printf("\nsqrt(h^2+k^2+l^2) = %.3f ",x)
printf("\nTherefore, h^2+k^2+l^2 =sqrt(2)")
printf("\nh =1, k=1")
|