summaryrefslogtreecommitdiff
path: root/1619/CH1/EX1.7.1/Example1_7_1.sce
blob: d6d4a12948aafe38383417d0e836c8936510acb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Example 1.7.1  page 1.14
//To calculate the angel of refraction if the angle of incidence is 30

clc;
clear;
n1= 1.5; // for glass
n2= 1.33; // for water
phi1= (%pi/6);          // phi1 is the angel of incidence
// According to Snell's law...
// n1*sin(phi1)= n2*sin(phi2);
sinphi2= (n1/n2)*sin(phi1); // phi2 is the angle of refraction..
phi2 = asind(sinphi2);
printf(' The angel of refraction is %.2f degrees',phi2);