1require_relative "../physics"23question :any_two_media do4 describes "A ray meets the boundary between two media, of indices %{first_index} and %{second_index}, at %{angle}. What " \5 "do they do to it?"6 given :first_index7 given :second_index8 given angle: "20 deg"9end
1require_relative "../questions/any_two_media"2require_relative "../science/ray_optics_and_optical_instruments/refraction"34solve :any_two_media, using: Refraction do5 take first_index: :mu_1, second_index: :mu_2, angle: :i6 find_whether :bends_toward_the_normal?7 find_whether :bends_away_from_the_normal?8 find_whether :no_refracted_ray?910 conclusion "They bend it, and which way follows from which of them is the denser."11end
1require_relative "../solutions/any_two_media"2require_relative "../science/ray_optics_and_optical_instruments/refractive_media"3require_relative "../pictures/light"45play_with :any_two_media do6 title "Any Two Media"78 input :from, REFRACTIVE_MEDIA9 input :into, REFRACTIVE_MEDIA, default: "glass"1011 input(:mu_1) { from }12 input(:mu_2) { into }1314 output :bends_toward_the_normal?15 output :bends_away_from_the_normal?16 output :no_refracted_ray?, alarm: true1718 draw Light::Picture do19 media :from, :into20 ray "incident", arriving_at: :i, extended: true21 ray "refracted", crossing_at: :r_r, unless: :no_refracted_ray?22 note "no refracted ray", when: :no_refracted_ray?23 end24end