question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_candle_before_a_concave_mirror do 4 kind :numerical 5 describes "A small candle, %{size} in size is placed at %{distance} in front of a concave mirror of radius of " \ 6 "curvature %{radius}. %{where}, in cm, measured along the incoming light from the mirror?" 7 given size: "2.5 cm" 8 given distance: "27 cm" 9 given radius: "36 cm" 10 asks where: "At what distance from the mirror should a screen be placed in order to obtain a sharp image" 11 end
1 require_relative "../questions/a_candle_before_a_concave_mirror" 2 require_relative "../science/ray_optics_and_optical_instruments/spherical_mirror" 3 4 solve :a_candle_before_a_concave_mirror , using: SphericalMirror do 5 objects :mirror 6 7 take size: mirror . object_height 8 take distance: mirror . distance_in_front 9 take radius: mirror . size_of_the_radius 10 11 deduce_from "concave" , mirror . radius_of_curvature => - mirror . size_of_the_radius 12 13 where = mirror . image_distance 14 answer where :, in: "cm" , figures: 2 15 16 conclusion "A candle beyond the centre of curvature of a concave mirror forms a real image in front of the " \ 17 "mirror, so a screen there catches it." 18 end
1 require_relative "../solutions/a_candle_before_a_concave_mirror" 2 3 play_with :a_candle_before_a_concave_mirror do 4 title "A Candle Before a Concave Mirror" 5 end