using System; using L=Science.Physics.GeneralPhysics; namespace ScienceTest.PhysicsTest.GeneralPhysicsTest { /// /// FinalPosition /// public class PositionTest { public PositionTest() { } private string result; public string Result { get{return result;} } L.Acceleration a = new L.Acceleration(); L.Velocity vi = new L.Velocity(); public void Compute() { L.Time t1 = new L.Time(); L.Time t2 = new L.Time(); t1.s = 0.0; t2.s = 2.0; //(A) vi.X = 63.0; double[] coeff = { vi.X, t2.s }; L.Complex[] ca = L.Calculus.SolutionOfPolynomialEquation(coeff); a.X = ca[0].Real; result += "a="+a.ToString()+"\r\n"; //(B) L.Position xi = new L.Position(); xi.X = 0.0; L.Vector.FunctionOfTime VelocityTime = new L.Vector.FunctionOfTime(Func2); L.Velocity vv = new L.Velocity(); vv.VectorFunctionOfTime = VelocityTime; L.Position x = new L.Position(t1,xi,vv,t2); result += "x_f="+x.ToString()+"\r\n"; } private L.Vector Func2(L.Time t) { L.Vector v = new L.Vector(); v.X = vi.X + a.X*t.s; v.Y = 10.0; v.Z = 10.0; return v; } } } /* a=-31.5 +/- 0 i +0 +/- 0 j +0 +/- 0 k (m/s^2) x_f=63 +/- 0 i +20 +/- 0 j +20 +/- 0 k (m) */