question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_polaroid_between_crossed_polaroids do 4 kind :numerical 5 describes "A polaroid sheet is placed between two crossed polaroids, with its pass-axis at %{angle} to that of the " \ 6 "first. %{share} of the light that comes out of the first polaroid?" 7 given angle: "45 deg" 8 asks share: "What share of it comes out of the last polaroid" 9 end
1 require_relative "../questions/a_polaroid_between_crossed_polaroids" 2 require_relative "../science/wave_optics/malus_law" 3 4 solve :a_polaroid_between_crossed_polaroids , using: MalusLaw do 5 objects :middle , :last , :both 6 7 take angle: middle . angle_to_the_light_s_polarisation 8 9 deduce_from "two crossed polaroids" , 10 last . angle_to_the_light_s_polarisation => pi / 2 - middle . angle_to_the_light_s_polarisation 11 deduce_from "placed between" , both . share_passed => middle . share_passed * last . share_passed 12 13 share = both . share_passed 14 answer share :, figures: 2 15 16 conclusion "Crossed polaroids alone pass nothing, but a third one between them, at an angle to both, turns " \ 17 "the light part of the way each time; at forty-five degrees a quarter gets through." 18 end
1 require_relative "../solutions/a_polaroid_between_crossed_polaroids" 2 3 play_with :a_polaroid_between_crossed_polaroids do 4 title "A Polaroid Between Crossed Polaroids" 5 end