using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter3.Section2 { 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[] at = { 0.0, 0.0 }; double[] h = { 0.01, 0.03 }; V.TaylorFormula obj = new V.TaylorFormula(f, at, h); obj.Compute(); result += obj.Result.ToString() + "\r\n"; result += (h[0] + 2.0*h[1]).ToString() + "\r\n"; } private double func(double[] x) { return Math.Sin(x[0] + 2.0 * x[1]); } } } // 0.07 // 0.07