using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter03 { /// /// Example04: The Resultant Displacement /// A particle undergoes three consecutive displacements: /// d_1 = (15i + 30j + 12k) cm, d_2 =(23i - 14j - 5k) cm /// and d_3 = (-13i + 15j) cm. Find the components of the /// resultant and its magnitude. /// public class Example04 { public Example04() { } private string result; public string Result { get{return result;} } public void Compute() { L.Displacement d1 = new L.Displacement(); d1.X = 15.0; d1.Y = 30.0; d1.Z = 12.0; L.Displacement d2 = new L.Displacement(); d2.X = 23.0; d2.Y = -14.0; d2.Z = -5.0; L.Displacement d3 = new L.Displacement(); d3.X = -13.0; d3.Y = 15.0; d3.Z = 0.0; L.Vector res = d1+(d2+d3); result += res.ToString(); result += res.Norm.ToString() + " "; result += Convert.ToString(Math.Sqrt(25*25+31*31+7*7)); } } } //25 +/- 0 i +31 +/- 0 j +7 +/- 0 k 40.4351332383115 40.4351332383115