blob: b3c8358be4f92d1dd11ac613f40224a1ff285024 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//chapter 4
//example 4.1
//Find spacing constant
//page 75
clear;
clc;
//given
lambda=2.6; // in Angstrom (wavelength)
theta=20; // in Degree (angle)
n=2;
//calculate
lambda=lambda*1E-10; // since lambda is in Angstrom
// Since 2dsin(theta)=n(lambda)
// therefore d=n(lambda)/2sin(theta)
d=n*lambda/(2*sind(theta));
printf('\nThe spacing constant is \td=%1.1E m',d);
d=d*1E10; // changing unit from m to Angstrom
printf('\n\t\t\t\td=%.1f Angstrom',d);
|