question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_girl_on_a_high_heel do 4 kind :numerical 5 describes "A %{mass} girl wearing high heel shoes balances on a single heel. The heel is circular with a diameter " \ 6 "%{diameter}. Taking g as %{gravity}, %{pressure}, in pascals?" 7 given mass: "50 kg" 8 given diameter: "1.0 cm" 9 given gravity: "9.8 m/s2" 10 asks pressure: "what is the pressure exerted by the heel on the horizontal floor" 11 end
1 require_relative "../questions/a_girl_on_a_high_heel" 2 require_relative "../science/mechanical_properties_of_fluids/pascals_law" 3 4 solve :a_girl_on_a_high_heel , using: PascalsLaw do 5 objects :girl , :heel 6 7 take mass: girl . mass 8 take diameter: heel . piston_diameter 9 take gravity: g 10 11 deduce_from "balances on a single heel" , heel . thrust => girl . mass * g 12 13 pressure = heel . pressure 14 answer pressure :, in: "Pa" , figures: 3 15 16 conclusion "Her whole weight rests on the tiny circle of one heel, so the pressure on the floor is " \ 17 "enormous, far more than her flat feet would press." 18 end
1 require_relative "../solutions/a_girl_on_a_high_heel" 2 3 play_with :a_girl_on_a_high_heel do 4 title "A Girl on a High Heel" 5 end