1require_relative "../physics"23question :the_needle_s_magnification do4 kind :numerical5 describes "A %{size} needle is placed %{distance} away from a convex mirror of focal length %{focal_length}. " \6 "%{magnification}?"7 given size: "4.5 cm"8 given distance: "12 cm"9 given focal_length: "15 cm"10 asks magnification: "What is the magnification"11end
1require_relative "../questions/the_needle_s_magnification"2require_relative "../science/ray_optics_and_optical_instruments/spherical_mirror"34solve :the_needle_s_magnification, using: SphericalMirror do5 objects :mirror67 take size: mirror.object_height8 take distance: mirror.distance_in_front9 take focal_length: mirror.size_of_the_focal_length1011 deduce_from "convex mirror", mirror.focal_length => mirror.size_of_the_focal_length1213 magnification = mirror.magnification14 answer magnification:, figures: 21516 conclusion "A convex mirror always gives an upright image smaller than the object, so the magnification is " \17 "positive and less than one."18end
1require_relative "../solutions/the_needle_s_magnification"23play_with :the_needle_s_magnification do4 title "The Needle's Magnification"5end