using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter6.Section3 { public class Example01 { public Example01() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(func); double[] from = { 0.0, 0.0 }; double[] to = { Math.PI, Math.PI }; V.IntegrationMultiD obj = new V.IntegrationMultiD(f, from, to); obj.Compute(); double ans = obj.BestEstimation / Math.PI / Math.PI; result += ans.ToString() + "\r\n"; obj.NumberOfCall = 10000000; obj.Compute(); double ans1 = obj.BestEstimation / Math.PI / Math.PI; result += ans1.ToString() + "\r\n"; } private double func(double[] x) { return x[0] * Math.Sin(x[0]*x[1]) * Math.Sin(x[0]*x[1]); } } } /* 0.783940321850329 0.78390551513066 */