using System; namespace Science.Mathematics.VectorCalculus { public class PathIntegral { private Path c; private double res; private Function.ToLastType f; public PathIntegral(Function.ToLastType function, Path path) { f = function; c = path; } public void Compute() { Function.ToLastType func = new Function.ToLastType(ff); IntegrationMidpoint obj = new IntegrationMidpoint(func, c.ParameterFrom, c.ParameterTo); obj.Compute(); res = obj.Result; } private double ff(double t) { Velocity v = new Velocity(c, t); v.Compute(); return f(c.Map(t))*v.Speed; } public double Result { get { return res; } } } }