using System; namespace Science.Mathematics.VectorCalculus { public class Acceleration : Vector { private Function.ToLastType c; private double at; private Velocity v; public Acceleration(Path path, double time) : base(path.Map(time).Length) { c = path.Map; at = time; v = new Velocity(path, 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) { v.At = t; v.Compute(); return v[i]; } } }