summaryrefslogtreecommitdiff
path: root/3753/CH7/EX7.11/Ex7_11.sce
blob: 88fe7d2918e50bc251a10dc99f49537ad35fe263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Example number 7.11, Page number 7.17

clc;clear;close

// Variable declaration
lamda=0.842 // in m
n1=1 // unitless
q=(8+(35/60))*(%pi/180) // unitless
n2=3 // unitless
d=1 // in m
// Calculations
// n*lamda=2*d*sin(theta)
// n1*0.842=2*d*sin(q)
// n3*0.842=2*d*sin(theta3)
// Dividing both the eauations, we get
// (n2*lamda)/(n1*lamda)=2*d*sin(theta3)/2*d*sin(q)
theta3=asin((((n2*lamda)/(n1*lamda))*(2*d*sin(q)))/(2*d)) // radian
d=theta3*180/%pi; // in m
a_d=int32(d); // // unitless
a_m=(d-int(d))*60 // // unitless

// Result
printf("sin(theta3) = %.f or %.3f ",a_d,a_m)