1require_relative "../physics"23question :internal_reflection do4 describes "Light in water meets air at %{angle}. %{reflected}?"5 given :angle6 asks reflected: "What happens to the light that is not refracted"7end
1require_relative "../questions/internal_reflection"2require_relative "../science/ray_optics_and_optical_instruments/reflection"3require_relative "../science/ray_optics_and_optical_instruments/refraction"4require_relative "../science/ray_optics_and_optical_instruments/refractive_media"56solve :internal_reflection, using: [ Reflection, Refraction ] do7 take angle: :i8 deduce_from "water", mu_1: REFRACTIVE_MEDIA.fetch("water")9 deduce_from "air", mu_2: REFRACTIVE_MEDIA.fetch("air")10 take reflected: :r_l11 find_value :reflected12 find_value :r_r13 find_whether :no_refracted_ray?1415 conclusion "It turns back into the water, and past this angle that is all of the light: the surface is a mirror. Slide down and the other ray returns, because some of it turns back at every angle."16end
1require_relative "../solutions/internal_reflection"2require_relative "../science/ray_optics_and_optical_instruments/refractive_media"3require_relative "../pictures/light"45play_with :internal_reflection do6 title "Internal Reflection"78 input :i, default: 60.deg910 output :r_l11 output :r_r12 output :no_refracted_ray?, alarm: true1314 draw Light::Picture, rising: true do15 media "water", "air"16 ray "incident", arriving_at: :i, angle: true17 ray "reflected", leaving_at: :r_l, angle: true18 ray "refracted", crossing_at: :r_r, angle: true, unless: :no_refracted_ray?19 note "all of it turns back", when: :no_refracted_ray?20 end21end