using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter04 { /// /// Example02: Approximating Projectile Motion /// A ball is thrown in such a way that its initial vertical /// and horizontal components of velocity are 40 m/s /// and 20 m/s, respectively. Estimate the total time of /// flight and the distance the ball is from its starting /// point when it lands. /// public class Example02 { public Example02() { } private string result; public string Result { get{return result;} } public void Compute() { L.Velocity v0 = new L.Velocity(); v0.X = 20.0; v0.Y = 40.0; double[] coe = {v0.Y, -L.Constant.AccelerationOfGravity}; L.Complex[] sol = L.Calculus.SolutionOfPolynomialEquation(coe); double time = 2.0*sol[0].Real; double distance = v0.X*time; result += time.ToString(); result += " and "+distance.ToString(); } } } //8.16326530612245 and 163.265306122449