question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_points_half_a_wavelength_apart do 4 kind :numerical 5 describes "For the travelling harmonic wave y(x, t) = 2.0 cos 2π (10t – 0.0080 x + 0.35) where x and y are in cm " \ 6 "and t in s, %{phase} separated by a distance of λ/2, in radians?" 7 asks phase: "what is the phase difference between oscillatory motion of two points" 8 end
1 require_relative "../questions/two_points_half_a_wavelength_apart" 2 require_relative "../science/waves/travelling_wave" 3 4 solve :two_points_half_a_wavelength_apart , using: TravellingWave do 5 objects :wave 6 7 deduce_from "2π (10t – 0.0080 x" , wave . wave_number => "0.0080 rev/cm" 8 deduce_from "λ/2" , wave . separation => wave . wavelength / 2 9 10 phase = wave . phase_difference 11 answer phase :, in: "rad" , figures: 2 12 13 conclusion "A whole wavelength is a full turn of phase, so half of one puts the two points in opposite phase, " \ 14 "whatever the wave." 15 end
1 require_relative "../solutions/two_points_half_a_wavelength_apart" 2 3 play_with :two_points_half_a_wavelength_apart do 4 title "Two Points Half a Wavelength Apart" 5 end