summaryrefslogtreecommitdiff
path: root/3411/CH1/EX1.6/Ex1_6.sce
blob: 99f489e0cd571609bc1dbd12c6e7510d69ea1a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Example 1.6
clc();
clear;
//Calculate the wavelengths of light in visible spectrum
i=35          //units in degrees
u=1.33
d=5*10^-5      //units in cm
r=asin(sin(i*%pi/180)/u)      //units in radians
r=r*180/%pi                   //units in degrees
//For n=1
n=1
lamda1=(2*u*d*cos(r*%pi/180))/n       //units in cm
printf("For n=1 lamda=%.6fcm which lies in infrared region",lamda1)
//For n=2
n=2
lamda2=(2*u*d*cos(r*%pi/180))/n      //units in cm
printf("\nFor n=2 lamda=%.6fcm which lies in visible region",lamda2)
//For n=3
n=3
lamda3=(2*u*d*cos(r*%pi/180))/n          //units in cm
printf("\nFor n=3 lamda=%.6fcm which lies in visible region",lamda3)
//For n=4
n=4
lamda4=(2*u*d*cos(r*%pi/180))/n        //units in cm
printf("\nFor n=4 lamda=%.6fcm which lies in ultraviolet region",lamda4)
printf("\nHence absent wavelengths in reflected region are %.6fcm  and %.6fcm",lamda2,lamda3)