1require_relative "../physics"23question :the_image_in_a_concave_lens do4 kind :numerical5 describes "An object of size %{size} is placed %{distance} in front of a concave lens of focal length " \6 "%{focal_length}. %{image_height}, in cm?"7 given size: "3.0 cm"8 given distance: "14 cm"9 given focal_length: "21 cm"10 asks image_height: "What is the size of the image"11end
1require_relative "../questions/the_image_in_a_concave_lens"2require_relative "../science/ray_optics_and_optical_instruments/thin_lens"34solve :the_image_in_a_concave_lens, using: ThinLens do5 objects :lens67 take size: lens.object_height8 take distance: lens.distance_in_front9 take focal_length: lens.size_of_the_focal_length1011 deduce_from "concave lens", lens.focal_length => -lens.size_of_the_focal_length1213 image_height = lens.image_height14 answer image_height:, in: "cm", figures: 21516 conclusion "The image is nearer the lens than the object, so it is smaller; being virtual, it stands upright."17end
1require_relative "../solutions/the_image_in_a_concave_lens"23play_with :the_image_in_a_concave_lens do4 title "The Image in a Concave Lens"5end