using System; namespace Science.Mathematics.VectorCalculus { public class TangentVector : Vector { private Path c; private double t; public TangentVector(Path path, double time) : base(path.Map(time).Length) { c = path; t = time; } public double Time { get { return t; } set { t = value; } } private Vector res; public Vector Result { get { return res; } } private int kth; public void Compute() { int n = c.Map(t).Length; res = new Vector(n); Function.ToLastType f = new Function.ToLastType(func); Differentiation obj = new Differentiation(f, t); for (int k = 0; k < n; k++) { kth = k; obj.Compute(); res[k] = obj.Result; } } private double func(double t) { return c.Map(t)[kth]; } } }