Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Crown Glass
- % Determines the difference in the angle of refraction between two
- % different colored rays within glass, and the minimum angle of incidence
- % at which the one ray can hit the surface
- % Inputs and Variables
- theta = input('Angle of incidence in degrees\n')*pi/180;
- n1 = input('Index of refraction of color one\n');
- n2 = input('Index of refraction of color two\n');
- % Outputs and Equations
- theta1 = asin(sin(theta)/n1);
- theta2 = asin(sin(theta)/n2);
- delta_theta = theta1 - theta2;
- theta1_min = asin(1/n);
- fprintf('The difference of angles is: %.3e rad\nthe minimum angle to break the surface is: %.3e rad', delta_theta, theta1_min)
- %{
- The user inputs the angle in degrees but it is stored in radians
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement