Example #1
0
        public override double IntegratePerimeterCartesian(Func <double, double, double> f, int steps)
        {
            Integral1 integral1 = new Integral1(() => 0, () => this.Size, steps);

            return(Integration.Integrate(x => f(x, 0), integral1)
                   + Integration.Integrate(y => f(this.Size, y), integral1)
                   + Integration.Integrate(x => f(x, this.Size), integral1)
                   + Integration.Integrate(y => f(0, y), integral1));
        }
Example #2
0
 public static double Integrate(Func <double, double, double> f, Integral1 integral1, Integral2 integral2)
 {
     return(Integration.Integrate(x => Integration.Integrate(y => f(x, y),
                                                             new Integral1(
                                                                 () => integral2.Lower(x),
                                                                 () => integral2.Upper(x),
                                                                 integral2.Steps)),
                                  integral1));
 }
Example #3
0
 public static double Integrate(Func <double, double, double, double> f, Integral1 integral1, Integral2 integral2, Integral3 integral3)
 {
     return(Integration.Integrate(
                (x, y) => Integration.Integrate(z => f(x, y, z),
                                                new Integral1(
                                                    () => integral3.Lower(x, y),
                                                    () => integral3.Upper(x, y),
                                                    integral3.Steps)),
                integral1, integral2));
 }
Example #4
0
 public override double IntegrateAreaCartesian(Func <double, double, double> f, int steps)
 {
     return(Integration.Integrate(f, new Integral1(() => 0, () => this.Size, steps),
                                  new Integral2(x => 0, x => this.Size, steps)));
 }
Example #5
0
 public static double Spherical(Func <double, double, double, double> f, Integral1 integral1, Integral2 integral2, Integral3 integral3)
 {
     return(Integration.Integrate((r, theta, phi) => r * r * Math.Sin(theta) * f(r, theta, phi), integral1, integral2, integral3));
 }
Example #6
0
 public static double Cylindrical(Func <double, double, double, double> f, Integral1 integral1, Integral2 integral2, Integral3 integral3)
 {
     return(Integration.Integrate((r, theta, z) => r * f(r, theta, z), integral1, integral2, integral3));
 }
Example #7
0
 public static double Polar(Func <double, double, double> f, Integral1 integral1, Integral2 integral2)
 {
     return(Integration.Integrate((r, theta) => r * f(r, theta), integral1, integral2));
 }
Example #8
0
 public override double IntegratePerimeterPolar(Func <double, double, double> f, int steps)
 {
     return(Integration.Integrate(theta => f(this.Radius, theta), new Integral1(() => 0, () => Math.PI * 2, steps)));
 }
Example #9
0
 public override double IntegrateSurfaceSpherical(Func <double, double, double, double> f, int steps)
 {
     return(Integration.Integrate((theta, phi) => this.Radius * this.Radius * Math.Sin(phi) * f(this.Radius, theta, phi),
                                  new Integral1(() => 0, () => Math.PI * 2, steps),
                                  new Integral2(theta => 0, theta => Math.PI, steps)));
 }