Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Laser Beam
- % Determines the angle of refraction of a laser beam and the time it takes
- % Constants
- c = 3*10^8; % [m/s] Speed of Light
- % Inputs and Variables
- d = input('Thickness of the glass\n');
- theta = input('Angle of incidence in degrees\n')*pi/180;
- n = input('Index of refraction\n');
- % Outputs and Equations
- theta2 = asin(sin(theta)/n);
- t = d*n/(c*cos(theta2));
- fprintf('Angle of refraction: %.3f rad\ntime it takes: %.3e s',theta2,t)
- %{
- This program uses snell's law (n1sin(theta1) = n2sin(theta2)) to calculate
- the unknown and n1 = 1 which is the index of refraction in air
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement