question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_converging_beam_through_a_convex_lens do 4 kind :numerical 5 describes "A beam of light converges at a point P. Now a lens is placed in the path of the convergent beam " \ 6 "%{distance} from P. %{where} if the lens is a convex lens of focal length %{focal_length}, in cm " \ 7 "from the lens?" 8 given distance: "12 cm" 9 given focal_length: "20 cm" 10 asks where: "At what point does the beam converge" 11 end
1 require_relative "../questions/a_converging_beam_through_a_convex_lens" 2 require_relative "../science/ray_optics_and_optical_instruments/thin_lens" 3 4 solve :a_converging_beam_through_a_convex_lens , using: ThinLens do 5 objects :lens 6 7 take distance: lens . object_distance 8 take focal_length: lens . size_of_the_focal_length 9 10 deduce_from "convex lens" , lens . focal_length => lens . size_of_the_focal_length 11 12 where = lens . image_distance 13 answer where :, in: "cm" , figures: 2 14 15 conclusion "The point the beam was heading for lies beyond the lens, so it is a virtual object at a positive " \ 16 "distance; a convex lens pulls the beam to a point nearer still." 17 end
1 require_relative "../solutions/a_converging_beam_through_a_convex_lens" 2 3 play_with :a_converging_beam_through_a_convex_lens do 4 title "A Converging Beam Through a Convex Lens" 5 end