question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_microwave_s_wavelength do 4 kind :numerical 5 describes "In a plane electromagnetic wave, the electric field oscillates sinusoidally at a frequency of " \ 6 "%{frequency} and amplitude 48 V/m. %{wavelength}, in cm?" 7 given frequency: "2.0e10 Hz" 8 asks wavelength: "What is the wavelength of the wave" 9 end
1 require_relative "../questions/a_microwave_s_wavelength" 2 require_relative "../science/electromagnetic_waves/electromagnetic_wave" 3 4 solve :a_microwave_s_wavelength , using: ElectromagneticWave do 5 objects :wave 6 7 take frequency: wave . frequency 8 9 wavelength = wave . wavelength 10 answer wavelength :, in: "cm" , figures: 2 11 12 conclusion "At tens of gigahertz the speed of light leaves room for only a centimetre or so per cycle, the " \ 13 "microwave part of the spectrum." 14 end
1 require_relative "../solutions/a_microwave_s_wavelength" 2 3 play_with :a_microwave_s_wavelength do 4 title "A Microwave's Wavelength" 5 end