Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Light in Plastic
- % Determines the speed of light inside plastic
- % Constants
- c = 3*10^8; % [m/s] speed of light
- % Inputs and Variables
- theta1 = input('Angle of incidence in degrees\n')*pi/180;
- theta2 = input('Angle of refraction in degrees\n')*pi/180;
- % Outputs and Equations
- n = sin(theta1)/sin(theta2);
- c2 = c/n;
- fprintf('The speed of light in plastic is: %.4e m/s',c2)
- %{
- The angles for thetas are asked in degrees but stored in radians
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement