Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Transparent Material
- % Determines the index of refraction of a material, angle of reflected ray,
- % angles of refracted rays
- % Inputs and Variables
- thetac = input('Thetac\n');
- theta1 = input('Striking the material angle for reflected\n');
- % Outputs and Equations
- n = 1/sind(thetac);
- theta2 = asind(sind(theta1)/n);
- theta3 = asind(n*sind(theta1));
- fprintf(['The index of refraction is: %.3f\n'...
- 'The reflected ray is: %.2f deg\n'...
- 'The refracted ray is: %.2f deg\n'...
- 'The leaving ray is: %.2f deg\n'],n,theta1,theta2,theta3)
- %{
- Yeah so it would take too much space to ask for the specifics of the
- problem in the command window so they are going here
- The first input is
- "The refractive index of a transparent material can be determined by
- measuring the critical angle when the solid is in air" and asks for that
- angle
- The second input is
- "A light ray strikes this material (from air) at an angle of 'theta' with
- respect to the normal of the surface"
- The outputs are going to be weird so heres the meaning list
- First output
- Index of refraction of the material
- Second Output
- Angle of the reflected ray
- Third Output
- Angle of refracted ray
- Four Output
- Angle of refracted ray when exiting the material
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement