using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter7.Section5 { 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.Surface s = new V.Surface(ff); s.Parameter1StartValue = 0.0; s.Parameter1EndValue = 1.0; s.Parameter2StartValue = -1.0; s.Parameter2EndValue = 1.0; Science.Mathematics.Function.ToLastType g = new Science.Mathematics.Function.ToLastType(gfunc); V.SurfaceIntegralScalar obj = new V.SurfaceIntegralScalar(g, s); obj.Compute(); result += obj.Result.ToString() + "\r\n"; double res = Math.Sqrt(2.0)*(Math.Sqrt(3.0) - 1.0 / 3.0); result += res.ToString() + "\r\n"; } private double[] func(double[] u) { double[] x = new double[3]; x[0] = u[0]; x[1] = u[1]; x[2] = u[0]*u[0]+u[1]; return x; } private double gfunc(double[] x) { return x[0]; } } } /* 1.9781045749717 1.97808522199215 */