Beispiel #1
0
        public static double IntegralRect(Fxdx obj, double dx)
        {
            double ans = 0;

            for (double st = obj.From; st <= obj.To; st += dx)
            {
                ans += obj.Fx(st);
            }
            ans *= dx;
            return(ans);
        }
Beispiel #2
0
 public static double IntegralRect(Fxdx obj, int pieces)
 {
     return(IntegralRect(obj, ((-obj.From + obj.To) / pieces)));
 }
Beispiel #3
0
        public static double Integral(Fxdx obj, int pieces)
        {
            double dx = (-obj.From + obj.To) / pieces;

            return(Integral(obj, dx));
        }