using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter4.Section4 { public class Example10 { public Example10() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(ff); double[] x = { 1.0, 2.0, 3.0 }; V.Curl delcrossf = new V.Curl(f, x); delcrossf.Compute(); result += delcrossf.Result.ToString(); x[0] = 2.0; x[1] = 4.0; x[2] = 5.0; delcrossf.Compute(); result += delcrossf.Result.ToString(); } private double[] ff(double[] x) { double[] r = new double[3]; r[0] = x[1] / (x[0] * x[0] + x[1] * x[1]); r[1] = -x[0] / (x[0] * x[0] + x[1] * x[1]); r[2] = 0.0; return r; } } } /* (0,0,1.33004718350094E-13) (0,0,2.89664126018607E-14) */