Advertisement
hiddenGem

Submerged Light

Jul 26th, 2020 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.34 KB | None | 0 0
  1. %% Submerged Light
  2. % Determines the radius of a circle from which a submerged light escapes
  3. % from water into air above
  4.  
  5. % Inputs and Variables
  6. d = input('How far is the light submerged?\n');
  7. n = input('What is the index of refraction?\n');
  8.  
  9. % Outputs and Equations
  10. theta = asin(1/n);
  11. r = d*tan(theta)
  12. fprintf('The radius is: %.3e m\n',r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement