You will write three functions about light at a boundary.
The idea. Snell's law is . When would be larger than , there is no refracted ray: the light is totally reflected. The critical angle exists only when light goes from a denser to a rarer material, and then . For a view straight down, the apparent depth is the real depth divided by . Angles are in degrees.
Your tasks.
refraction_angle, return in degrees. Return None when the light is totally reflected.critical_angle, return in degrees. Return None when is not larger than .apparent_depth, return the apparent depth for a view straight down.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…