using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter7.Section2 { public class Example03 { public Example03() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType ff = new Science.Mathematics.Function.ToLastType(func); V.Path c = new V.Path(ff); c.ParameterFrom = 0.0; c.ParameterTo = 2.0; Science.Mathematics.Function.ToLastType fff = new Science.Mathematics.Function.ToLastType(f); V.VectorField F = new V.VectorField(fff); V.LineIntegral obj = new V.LineIntegral(F, c); obj.Compute(); result += obj.Result.ToString() + "\r\n"; double res = 2.0*Math.E + 0.5*Math.Pow(Math.E,4.0) - 0.5; result += res.ToString() + "\r\n"; } private double[] func(double t) { double[] x = new double[3]; x[0] = 1.0; x[1] = t; x[2] = Math.Exp(t); return x; } private double[] f(double[] x) { double[] r = new double[3]; r[0] = Math.Cos(x[0]); r[1] = Math.Exp(x[0]); r[2] = Math.Exp(x[1]); return r; } } } /* 32.2356386733975 32.2356386734902 */