using System; using GP = Science.Physics.GeneralPhysics; namespace ScienceTest.PhysicsTest.GeneralPhysicsTest { /// /// WorkEnergyTheoremTest /// public class TotalEnergyTest { public TotalEnergyTest() { } private string result; public string Result { get{return result;} } public void Compute() { GP.Displacement x = new GP.Displacement(); x.X = 1.0; x.Y = 2.0; x.Z = 3.0; GP.Force f = new GP.Force(); f.X = 2.0; f.Y = 4.0; f.Z = 5.0; GP.Work[] w = new GP.Work[3]; w[0] = new GP.Work(); w[1] = new GP.Work(); w[2] = new GP.Work(f,x); w[0].J = 2.0; w[1].J = 3.0; GP.KineticEnergy initial = new GP.KineticEnergy(); initial.J = 23.0; GP.KineticEnergy final = new GP.KineticEnergy(); final.VariableQ = true; // true for only one variable GP.FundamentalLaw.WorkEnergyTheorem(initial,w,final); result += final.ToString(); } } } //53 +/- 0 (J)