using System; namespace Science.Physics.GeneralPhysics { /// /// Velocity /// public class Velocity : Vector { private void SetDim() { this.DimensionMass = 0; this.DimensionLength = 1; this.DimensionTime = -1; } public Velocity() { SetDim(); } public Velocity(Displacement d, Time t) { SetDim(); this.X = d.X/t.Interval; this.Y = d.Y/t.Interval; this.Z = d.Z/t.Interval; } public Velocity(Vector.FunctionOfTime func) : base(func) { SetDim(); } public Velocity(Mass m, KineticEnergy k) { SetDim(); this.X = Math.Sqrt(2.0*k.J/m.kg); } public Velocity(Position r, Time t) { SetDim(); Vector v = VectorCalculus.TimeDerivative(r, t); this.X = v.X; this.Y = v.Y; this.Z = v.Z; } public Velocity(Time tInitial, Velocity vInitial, Acceleration a, Time tFinal) { SetDim(); Vector v = VectorCalculus.TimeIntegral(a,tInitial,tFinal); this.X = vInitial.X + v.X; this.Y = vInitial.Y + v.Y; this.Z = vInitial.Z + v.Z; } public double mPERs { get{return this.Norm;} } public override string ToString() { return base.ToString() + "(m/s)"; } } }