using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace ScienceTest.MathematicsTest.VectorCalculusTest { public class CurlTest { public CurlTest() { } private string result; public string Result { get{return result;} } public void Compute() { V.Function.ToLastType f = new V.Function.ToLastType(func); double[] at = { 1.0, 2.0, 3.0 }; V.Curl obj = new V.Curl(f, at); obj.Compute(); result += obj.Result[0].ToString() + "\r\n"; result += obj.Result[1].ToString() + "\r\n"; result += obj.Result[2].ToString() + "\r\n"; at[0] = 12.0; at[1] = 13.0; at[2] = 14.0; obj.Compute(); result += obj.Result[0].ToString() + "\r\n"; result += obj.Result[1].ToString() + "\r\n"; result += obj.Result[2].ToString() + "\r\n"; } private double[] func(double[] x) { double[] f = new double[3]; f[0] = x[2]*x[1]; f[1] = x[0]*x[1]*x[2]; f[2] = x[1]*x[0]*x[0]; return f; } } } /* -0.999999999999829 -1.99999999999982 2.99999999999935 -12.0000000008721 -299.000000000036 167.999999999984 */