1require_relative "../physics"23question :a_pendulum_that_ticks_seconds do4 kind :numerical5 describes "Taking g as %{gravity}, %{length}, in metres?"6 given gravity: "9.8 m/s2"7 asks length: "what is the length of a simple pendulum, which ticks seconds"8end
1require_relative "../questions/a_pendulum_that_ticks_seconds"2require_relative "../science/oscillations/simple_pendulum"34solve :a_pendulum_that_ticks_seconds, using: SimplePendulum do5 objects :earth6 object :pendulum, on: earth78 take gravity: earth.surface_gravity910 deduce_from "ticks seconds", pendulum.period => "2 s"1112 length = pendulum.length_of_the_string13 answer length:, in: "m", figures: 21415 conclusion "A pendulum that ticks once a second swings there and back in two, and that period fixes " \16 "its length: about a metre."17end
1require_relative "../solutions/a_pendulum_that_ticks_seconds"23play_with :a_pendulum_that_ticks_seconds do4 title "A Pendulum That Ticks Seconds"5end