FNTrapezoidapproximates the integral of the function whose samples are in the arrayA. The elements ofAare assumed to be equally-spaced. The parameterscontains the value of the distance between adjacent elements ofA.
The integral is calculated by summing half the value of the first and last points inAand the values of the interior points inA. This sum is multiplied bys. This method is often called thetrapezoid rule, and is described in most texts on numerical mathematical methods.
Errors
FNTrapezoidcauses an HTBasic error if the arrayAcontains fewer than 2 points.