question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_moon_s_month do 4 kind :numerical 5 describes "Kepler's constant for orbits round the Earth is k = %{constant}, so that T² = kR³. The Moon is at a " \ 6 "distance of %{distance} from the Earth. %{period}, in days?" 7 given constant: "1e-13 s2/m3" 8 given distance: "3.84e5 km" 9 asks period: "What is its time period of revolution" 10 end
1 require_relative "../questions/the_moon_s_month" 2 require_relative "../science/gravitation/earth_satellites" 3 4 solve :the_moon_s_month , using: EarthSatellites do 5 objects :moon 6 paths :orbit 7 moon . goes ( :round , on: orbit ) 8 9 take constant: orbit . keplers_constant 10 take distance: orbit . radius 11 12 period = round . period 13 answer period :, in: "d" , figures: 3 14 15 conclusion "Every orbit round the Earth shares one constant, so the period follows from the distance " \ 16 "alone, as the square root of its cube times that constant." 17 end
1 require_relative "../solutions/the_moon_s_month" 2 3 play_with :the_moon_s_month do 4 title "The Moon's Month" 5 end