question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :double_convex_lenses_of_one_radius do 4 kind :numerical 5 describes "Double-convex lenses are to be manufactured from a glass of refractive index %{index}, with both " \ 6 "faces of the same radius of curvature. %{radius} if the focal length is to be %{focal_length}, in " \ 7 "cm?" 8 given index: "1.55" 9 given focal_length: "20 cm" 10 asks radius: "What is the radius of curvature required" 11 end
1 require_relative "../questions/double_convex_lenses_of_one_radius" 2 require_relative "../science/ray_optics_and_optical_instruments/thin_lens" 3 4 solve :double_convex_lenses_of_one_radius , using: ThinLens do 5 objects :lens 6 7 take index: lens . refractive_index_of_the_lens 8 take focal_length: lens . focal_length 9 10 deduce_from "same radius of curvature" , lens . second_radius => - lens . first_radius 11 deduce_from "manufactured from a glass" , lens . index_of_the_surroundings => "1" 12 13 radius = lens . first_radius 14 answer radius :, in: "cm" , figures: 2 15 16 conclusion "The two faces bulge outward equally, so their radii are equal and opposite in sign and each bends " \ 17 "the light by the same amount." 18 end
1 require_relative "../solutions/double_convex_lenses_of_one_radius" 2 3 play_with :double_convex_lenses_of_one_radius do 4 title "Double-Convex Lenses of One Radius" 5 end