using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter02 { /// /// Example12: Not a Bad Throw for a Rookie! /// A stone thrown from the top of a building is given an /// initial velocity of 20.0 m/s straight upward. The building /// is 50.0 m high, and the stone just misses the edge of the /// roof on its way down, as shown in Figure 2.14. /// Using t_A = 0 as the time the stone leaves the thrower's /// hand at position A, determine /// (A) the time at which the stone reaches its maximum height, /// (B) the maximum height, /// (C) the time at which the stone returns to the height /// from which it was thrown, /// (D) the velocity of the stone at this instant, and /// (E) the velocity and position of the stone at t = 5.00 s. /// public class Example12 { public Example12() { } private string result; public string Result { get{return result;} } public void Compute() { L.Velocity v0 = new L.Velocity(); v0.Z = 20.0; double[] coe = {v0.Z, - L.Constant.AccelerationOfGravity}; //(A) L.Complex[] p = L.Calculus.SolutionOfPolynomialEquation(coe); result += p[0].ToString()+"\r\n"; //(B) result += Convert.ToString(v0.Z*p[0].Real - 0.5*L.Constant.AccelerationOfGravity *p[0].Real*p[0].Real)+"\r\n"; //(C) result += Convert.ToString(2.0*p[0].Real)+"\r\n"; //(D) result += Convert.ToString(-v0.Z)+"\r\n"; //(E) result += Convert.ToString(v0.Z - L.Constant.AccelerationOfGravity*5.0)+"\r\n"; result += Convert.ToString(0.0+v0.Z*5.0 - 0.5*L.Constant.AccelerationOfGravity *5.0*5.0)+"\r\n"; } } } /* 2.04081632653061 20.4081632653061 4.08163265306122 -20 -29 -22.5 */