using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter7.Section1 { public class Example02 { public Example02() { } 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 = Math.PI / 2.0; Science.Mathematics.Function.ToLastType fff = new Science.Mathematics.Function.ToLastType(f); V.PathIntegral obj = new V.PathIntegral(fff, c); obj.Compute(); result += obj.Result.ToString() + "\r\n"; double res = 225.0; result += res.ToString() + "\r\n"; } private double[] func(double t) { double[] x = new double[2]; x[0] = 30.0 * Math.Cos(t) * Math.Cos(t) * Math.Cos(t); x[1] = 30.0 * Math.Sin(t) * Math.Sin(t) * Math.Sin(t); return x; } private double f(double[] x) { return 1.0 + x[1]/3.0; } } } /* 224.999999999213 225 */