1require_relative "../physics"23question :refraction do4 describes "%{refracted} when it passes from air into water at %{angle}?"5 given :angle6 asks refracted: "Where does a ray go"7end
1require_relative "../questions/refraction"2require_relative "../science/ray_optics_and_optical_instruments/refraction"3require_relative "../science/ray_optics_and_optical_instruments/refractive_media"45solve :refraction, using: Refraction do6 take angle: :i7 deduce_from "air", mu_1: REFRACTIVE_MEDIA.fetch("air")8 deduce_from "water", mu_2: REFRACTIVE_MEDIA.fetch("water")9 take refracted: :r_r10 find_value :refracted1112 conclusion "It goes through, and bends toward the normal doing so. The two angles are neither equal nor proportional: what each medium does to the sine of its own angle, the other undoes."13end
1require_relative "../solutions/refraction"2require_relative "../science/ray_optics_and_optical_instruments/refractive_media"3require_relative "../pictures/light"45play_with :refraction do6 title "Refraction: Air to Water"78 input :i, default: 60.deg910 output :r_r1112 draw Light::Picture do13 media "air", "water"14 ray "incident", arriving_at: :i, angle: true, extended: true15 ray "refracted", crossing_at: :r_r, angle: true16 end17end