question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :between_two_crests do 4 kind :numerical 5 describes "A transverse harmonic wave on a string is described by y(x, t) = 3.0 sin (36 t + 0.018 x + π/4) where x " \ 6 "and y are in cm and t in s. %{distance}, in metres?" 7 asks distance: "What is the least distance between two successive crests in the wave" 8 end
1 require_relative "../questions/between_two_crests" 2 require_relative "../science/waves/travelling_wave" 3 4 solve :between_two_crests , using: TravellingWave do 5 objects :wave 6 7 deduce_from "0.018 x" , wave . wave_number => "0.018 rad/cm" 8 9 distance = wave . wavelength 10 answer distance :, in: "m" , figures: 2 11 12 conclusion "Successive crests are a full turn of phase apart along the string, and that distance is the " \ 13 "wavelength." 14 end
1 require_relative "../solutions/between_two_crests" 2 3 play_with :between_two_crests do 4 title "Between Two Crests" 5 end