using System; using Science.Mathematics; using C = Science.Mathematics.Calculus; namespace ScienceTest.MathematicsTest.CalculusTest { public class Integration3DTest { public Integration3DTest() { } private string result; public string Result { get{return result;} } public void Compute() { C.Integration3D obj = new C.Integration3D(); Function.DoubleDoubleDoubleToDouble func = new Function.DoubleDoubleDoubleToDouble(f); Science.Mathematics.Function.DoubleDoubleToDouble z1p = new Science.Mathematics.Function.DoubleDoubleToDouble(z1); Science.Mathematics.Function.DoubleDoubleToDouble z2p = new Science.Mathematics.Function.DoubleDoubleToDouble(z2); Science.Mathematics.Function.DoubleToDouble y1p = new Science.Mathematics.Function.DoubleToDouble(y1); Science.Mathematics.Function.DoubleToDouble y2p = new Science.Mathematics.Function.DoubleToDouble(y2); obj.Function3D = func; obj.FromFunction2D = z1p; obj.ToFunction2D = z2p; obj.FromFunction1D = y1p; obj.ToFunction1D = y2p; obj.From = -2.0; obj.To = 2.0; obj.Compute(); result = Convert.ToString(obj.Result); result += " " + Convert.ToString(4.0 / 3.0 * Math.PI * 2.0 * 2.0 * 2.0); } private double f(double x, double y, double z) { return 1.0; } private double z2(double x, double y) { return Math.Sqrt(4.0 - x * x - y * y); } private double z1(double x, double y) { return -Math.Sqrt(4.0 - x * x - y * y); } private double y2(double x) { return Math.Sqrt(4.0 - x * x); } private double y1(double x) { return -Math.Sqrt(4.0 - x * x); } } }