question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_fifty_megahertz_wave_s_magnetic_field do 4 kind :numerical 5 describes "Suppose that the electric field amplitude of an electromagnetic wave is E₀ = %{electric} and that " \ 6 "its frequency is ν = %{frequency}. %{magnetic}, in teslas?" 7 given electric: "120 N/C" 8 given frequency: "50.0 MHz" 9 asks magnetic: "What is the amplitude of its magnetic field, B₀" 10 end
1 require_relative "../questions/a_fifty_megahertz_wave_s_magnetic_field" 2 require_relative "../science/electromagnetic_waves/electromagnetic_wave" 3 4 solve :a_fifty_megahertz_wave_s_magnetic_field , using: ElectromagneticWave do 5 objects :wave 6 7 take electric: wave . electric_field 8 take frequency: wave . frequency 9 10 magnetic = wave . magnetic_field 11 answer magnetic :, in: "T" , figures: 3 12 13 conclusion "The magnetic field of a light wave is its electric field over the speed of light, tiny in teslas " \ 14 "whatever the frequency." 15 end
1 require_relative "../solutions/a_fifty_megahertz_wave_s_magnetic_field" 2 3 play_with :a_fifty_megahertz_wave_s_magnetic_field do 4 title "A 50 MHz Wave's Magnetic Field" 5 end