using System; namespace Science.Mathematics.VectorCalculus { public class Velocity : Vector { private Function.ToLastType c; private double at; public Velocity(Path path, double time) : base(path.Map(time).Length) { c = path.Map; at = time; } public double At { set { at = value; } } public void Compute() { int l = c(at).Length; Function.ToLastType f; Differentiation obj; for (int j = 0; j < l; j++) { i = j; f = new Function.ToLastType(ff); obj = new Differentiation(f, at); obj.Compute(); this[j] = obj.Result; } } private int i = 0; private double ff(double t) { return c(t)[i]; } public double Speed { get { return this.Norm; } } } }