question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :umbrella_in_the_rain do 4 kind :numerical 5 describes "Rain falls straight down at %{rain_speed}, and a wind then blows it sideways at %{wind_speed}. %{tilt}, in degrees?" 6 given rain_speed: "35 m/s" 7 given wind_speed: "12 m/s" 8 asks tilt: "At what angle from the vertical should you tilt your umbrella" 9 end
1 require_relative "../questions/umbrella_in_the_rain" 2 require_relative "../science/motion_in_a_plane/vectors" 3 4 solve :umbrella_in_the_rain , using: Vectors do 5 take rain_speed: :A , wind_speed: :B 6 deduce_from "sideways" , phi: "90 deg" 7 take tilt: :beta 8 answer find_value ( :tilt , in: "deg" ) 9 10 conclusion "The rain arrives along the sum of its fall and the wind's push, and the umbrella " \ 11 "should face along that sum, tilted into the wind." 12 end
1 require_relative "../solutions/umbrella_in_the_rain" 2 3 play_with :umbrella_in_the_rain do 4 title "An Umbrella in the Rain" 5 end