1require_relative "../physics"23question :out_of_water_at_sixty do4 kind :mcq5 describes "Light in water meets the surface with air at %{angle} to the normal. Which are true?"6 given angle: "60 deg"78 option "No refracted ray leaves the water", as: :none_out9 option "Some of the light gets out into the air", as: :some_out10 option "60° is past water's critical angle", as: :past11 option "The ray bends toward the normal as it leaves", as: :toward12end
1require_relative "../questions/out_of_water_at_sixty"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 :out_of_water_at_sixty, using: [ Reflection, Refraction ] do7 objects :light, :water, :air8 light.goes(:incident, through: water)9 light.goes(:refracted, through: air, after: incident)10 take angle: light.angle_to_the_normal(during: incident)11 deduce_from "water", water.refractive_index => REFRACTIVE_MEDIA.fetch("water")12 deduce_from "air", air.refractive_index => REFRACTIVE_MEDIA.fetch("air")13 take none_out: light.angle_to_the_normal(during: incident) > c,14 some_out: light.angle_to_the_normal(during: incident) < c,15 past: light.angle_to_the_normal(during: incident) > c,16 toward: light.angle_to_the_normal(during: refracted) < light.angle_to_the_normal(during: incident)17 answer options.select { |o| holds?(o.taken) }1819 conclusion "Past the critical angle Snell's law would need a sine above one, and no angle has " \20 "that, so there is no refracted ray. All of the light turns back into the water."21end
1require_relative "../solutions/out_of_water_at_sixty"2require_relative "../pictures/light"34play_with :out_of_water_at_sixty do5 title "Out of water at 60°"67 draw Light::Picture, rising: true do8 media "water", "air"9 ray "incident", arriving_at: :i, angle: true, extended: true10 end11end