//Example 25.2 n1=1;//Index of refraction for air theta1=30;//Incident angle (deg) theta2=22;//Angle of refraction (deg) n2=n1*sind(theta1)/sind(theta2);//Index of refraction for medium 2 printf('Index of refraction for medium 2 = %0.2f',n2) //Openstax - College Physics //Download for free at http://cnx.org/content/col11406/latest