question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_helium_neon_laser_s_photons do 4 kind :numerical 5 describes "Monochromatic light of wavelength %{wavelength} is produced by a helium-neon laser. %{energy}, in J?" 6 given wavelength: "632.8 nm" 7 asks energy: "What is the energy of each photon in the light beam" 8 end
1 require_relative "../questions/a_helium_neon_laser_s_photons" 2 require_relative "../science/dual_nature_of_radiation_and_matter/photon" 3 4 solve :a_helium_neon_laser_s_photons , using: Photon do 5 objects :beam 6 7 take wavelength: beam . wavelength 8 9 energy = beam . photon_energy 10 answer energy :, in: "J" , figures: 3 11 12 conclusion "A photon's energy is Planck's constant times its frequency, and the frequency is the speed of light " \ 13 "over the wavelength." 14 end
1 require_relative "../solutions/a_helium_neon_laser_s_photons" 2 3 play_with :a_helium_neon_laser_s_photons do 4 title "A Helium-Neon Laser's Photons" 5 end