question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_small_spheres_thirty_centimetres_apart do 4 kind :numerical 5 describes "Two small charged spheres having charges of %{first} and %{second} are placed %{apart} apart in air. " \ 6 "%{force}, in newtons?" 7 given first: "2e-7 C" 8 given second: "3e-7 C" 9 given apart: "30 cm" 10 asks force: "What is the force between them" 11 end
1 require_relative "../questions/two_small_spheres_thirty_centimetres_apart" 2 require_relative "../science/electric_charges_and_fields/coulombs_law" 3 4 solve :two_small_spheres_thirty_centimetres_apart , using: CoulombsLaw do 5 objects :first , :second 6 7 take first: first . charge 8 take second: second . charge 9 take apart: first . separation ( from: second ) 10 11 force = first . electric_force ( by: second ) 12 answer force :, in: "N" , figures: 2 13 14 conclusion "Like charges push each other apart with a force that grows with each charge and falls off as the " \ 15 "square of the distance between them." 16 end
1 require_relative "../solutions/two_small_spheres_thirty_centimetres_apart" 2 3 play_with :two_small_spheres_thirty_centimetres_apart do 4 title "Two Small Spheres Thirty Centimetres Apart" 5 end