Advertisement
hiddenGem

Crown Glass

Jul 26th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.72 KB | None | 0 0
  1. %% Crown Glass
  2. % Determines the difference in the angle of refraction between two
  3. % different colored rays within glass, and the minimum angle of incidence
  4. % at which the one ray can hit the surface
  5.  
  6. % Inputs and Variables
  7. theta = input('Angle of incidence in degrees\n')*pi/180;
  8. n1 = input('Index of refraction of color one\n');
  9. n2 = input('Index of refraction of color two\n');
  10.  
  11. % Outputs and Equations
  12. theta1 = asin(sin(theta)/n1);
  13. theta2 = asin(sin(theta)/n2);
  14. delta_theta = theta1 - theta2;
  15. theta1_min = asin(1/n);
  16. fprintf('The difference of angles is: %.3e rad\nthe minimum angle to break the surface is: %.3e rad', delta_theta, theta1_min)
  17.  
  18. %{
  19. The user inputs the angle in degrees but it is stored in radians
  20. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement