question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_fifty_megahertz_wave_s_wavelength do 4 kind :numerical 5 describes "Suppose that the electric field amplitude of an electromagnetic wave is E₀ = 120 N/C and that its " \ 6 "frequency is ν = %{frequency}. %{wavelength}, in metres?" 7 given frequency: "50.0 MHz" 8 asks wavelength: "What is its wavelength, λ" 9 end
1 require_relative "../questions/a_fifty_megahertz_wave_s_wavelength" 2 require_relative "../science/electromagnetic_waves/electromagnetic_wave" 3 4 solve :a_fifty_megahertz_wave_s_wavelength , using: ElectromagneticWave do 5 objects :wave 6 7 take frequency: wave . frequency 8 9 wavelength = wave . wavelength 10 answer wavelength :, in: "m" , figures: 3 11 12 conclusion "Every electromagnetic wave in vacuum travels at the speed of light, so its wavelength is that speed " \ 13 "over its frequency." 14 end
1 require_relative "../solutions/a_fifty_megahertz_wave_s_wavelength" 2 3 play_with :a_fifty_megahertz_wave_s_wavelength do 4 title "A 50 MHz Wave's Wavelength" 5 end