using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter07 { /// /// Example03: Work Done by a Constant Force /// A particle moving in the xy plane /// displacement \Delta r = (2.0i + 3.0j) m as a constant /// force F = (5.0i + 2.0j) N acts on the particle. /// (A) Calculate the magnitudes of the displacement and /// the force. /// \Delta r = 3.6 m /// F = 5.4 N /// (B) Calculate the work done by F. /// W = 16 J /// public class Example03 { public Example03() { } private string result; public string Result { get{return result;} } public void Compute() { L.Vector deltaR = (2.0*L.UnitVector.i) + (3.0*L.UnitVector.j); L.Vector F = (5.0*L.UnitVector.i) + (2.0*L.UnitVector.j); result += Convert.ToString(deltaR.Norm)+" "; result += Convert.ToString(F.Norm)+" "; L.Scalar s = F * deltaR; result += s.ToString()+" "; } } } //3.60555127546399 5.3851648071345 16 +/- 0