[ P rev | Main | Next ]

MidPointTrapezoid Applet



MidPointTrapezoid is used to illustrate the midpoint and trapezoid methods and to compare them to the left and right Riemann sums. The user can select which method to use and the number of intervals. Positive area is shown in green, negative area in red.

The applet tag that creates the applet is as follows:

<applet code="net.sourceforge.webcompmath.calculus.MidPointTrapezoid" codebase="../../assets"
archive="webcompmath.jar,calculus.jar" height="400" width="640">
<param name="UseLoadButton" value="no" />
<param name="Example1" value="1. Line;x;-1;1;4;0;-2,2,-1,1" />
<param name="Example2" value="2. Parabola;x^2;-1;1;4;0;-2,2,-1,1" />
<param name="Example3" value="3. Cubic;x^3;-1;1;4;0;-2,2,-1,1" />
<param name="Example4" value="4. Cosine;cos(x);-1;1;4;0;-2,2,-1,1" />
<param name="Example5" value="5. Sine;sin(x);-1;1;4;0;-2,2,-1,1" />
</applet>

This applet takes the following parameters:

Param Name Type Default Description
Example1, ... String N/A Each example is a list of strings separated by semicolons. The strings, in order, are:
1. The name of the example, displayed in the example menu.
2. The expression for f(x), the function.
3. The value for a.
4. The value for b.
5. The number of intervals.
6. Whether to use left, right, midpoint, or trapezoid method. Use "0" for left, "1" for right, "2" for midpoint, and "3" for trapezoid.
7. The xmin, xmax, ymin, and ymax to use for the graph, as a list of comma-separated numbers.


[ Prev | Main | Next ]