summaryrefslogtreecommitdiff
path: root/1847/CH3/EX3.32/Ch03Ex32.sce
blob: ce3a19049fbe048c21095ffe661bc4a6adf3025d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Scilab Code Ex3.32:: Page-3.50 (2009)
clc; clear;
// Function to convert theta into degree-minute
function[degre, minute]=deg_2_degminsec(theta)
    degre = floor(theta);
    minute = (theta-floor(theta))*60;
endfunction

N = 15000;      // No. of lines on the grating per inch, lines/inch
a_plus_b = 2.54/N;      // Grating element, cm
lambda = 6000e-008;     // Wavelength of light used, cm
n = 1;      // Order of diffraction spectra
// But a_plus_b*sind(theta)=n*lambda, solving for theta
theta = asind(n*lambda/a_plus_b);       // Direction in which first order spectra is seen, degrees
[deg, mint] = deg_2_degminsec(theta);
printf("\nThe angle of diffraction for maxima in first order = %2d degrees %2d min", deg, mint);

// Result 
// The angle of diffraction for maxima in first order = 20 degrees 45 min