You will write three functions for a prism.
The idea. For a ray with angle of incidence on a prism of angle and index , Snell's law gives . Then , and Snell's law at the second face gives . The deviation is . At minimum deviation . The largest prism angle that lets light out is , where . All angles are in degrees.
Your tasks.
deviation, return the deviation in degrees, or None if the light is totally reflected at the second face.min_deviation, return the minimum deviation in degrees.max_prism_angle, return the largest prism angle that lets light out, in degrees.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…