Class Midpoint

  • All Implemented Interfaces:
    Integrator, IterativeIntegrator

    public class Midpoint
    extends NewtonCotes
    The midpoint rule computes an approximation to a definite integral, made by finding the area of a collection of rectangles whose heights are determined by the values of the function. Specifically, the interval over which the function is to be integrated is divided into equal subintervals of length. The rectangles are then drawn. The approximation to the integral is then calculated by adding up the areas (base multiplied by height) of the rectangles.
    See Also:
    Wikipedia: Rectangle method
    • Constructor Detail

      • Midpoint

        public Midpoint​(double precision,
                        int maxIterations)
        Construct an integrator that implements the Midpoint rule.
        Parameters:
        precision - the convergence threshold
        maxIterations - the maximum number of iterations