Advertisement
hiddenGem

Underwater Sunset

Jul 26th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.27 KB | None | 0 0
  1. %% Underwater Sunset
  2. % Determines the angle with respect to the vertical that a diver under the
  3. % water can see the sunset
  4.  
  5. % Inputs and Variables
  6. n = input('Index of refraction\n');
  7.  
  8. % Outputs and Equations
  9. theta = asin(1/n);
  10. fprintf('The angle is: %.3e rad', theta)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement