Webcompmath Project

Calculus Applets

An applet is placed on a Web page using an "applet tag" in the html source code for the page. An applet tag can include "params" to customize the applet. Each param has a name and a value. When the applet runs, it can retrieve the value associated to a given param name, and configure itself accordingly.

Here is an example of an applet tag that uses several applet params:

<applet code="net.sourceforge.webcompmath.calculus.ArcLength" codebase="../../assets"
archive="webcompmath.jar,calculus.jar" height="400" width="400">
<param name="UseLoadButton" value="no" />
<param name="Example1" value="1. Standard;x^2;0;1;-1;2;0;false;-1.5,2.5,-1,5" />
<param name="Example2" value="2. Inverse;y^2;0;1;-1;2;1;false;-1,5,-1.5,2.5" />
<param name="Example3" value="3. Parametric;cos(t);sin(t);2;0;3.14159;2;false;-1.1,1.1,-0.545,1.545" />
<param name="Example4" value="4. Polar;th;0;4;0;6;3;false;-7,7,-7.38,7.38" />

This example is for the ArcLength applet. The first line specifes which applet to run and where the .jar files live, which contain the applets. The applet name in the code attribute must include the prefix net.sourceforge.webcompmath.calsulus. In this example the .jar files live in a directory names "assets" that is up two levels from the current .html file (i.e., the codebase attribute here describes a relative path to the .jar files). If you put the .jar files in the same directory as your .html file, then you would just use codbase="." where "." indicates the current directory. If you put your .jar files in a directory named assets which is in the same directory as your .html file, you would use codebase="./assets". Putting your .jar files into an assets directory can be useful if you have several Web pages in different directories -- you will still only need the two .jar files. This can be more efficient for users of your pages, since a Web browser can just download the file once even if the user visits several Web pages that use the file.The archive attribute just lists the .jar files that are needed. The height and width attributes describe the size of the applet on the web page, in pixels.

The param attributes all have a name and a value. The name specifies the type of parameter and the value is assigned to that parameter by your web browser and is then used by the applet when it loads. The following params are common to most of the calculus applets.

Param Name Type Default Description
UseLoadButton yes/no yes If "yes" a Load Example button is displayed at the top of the appler, next to the examples menu. The user can select an example from the menu, but the example isn't loaded into the applet until the user clicks the Load Example button. If "no" then no Load Example button is displayed and the example loads immediately after the user selects it from the menu.
Presentation yes/no no This tells the applet that it will be projected on a screen, so it should use big fonts, thick lines, and larger points and cross hairs. The font size is set to 20, unless the FontSize parameter is also set (in which case, that font size is used).
String (none) These params can be used to define examples that are presented to the user in a menu at the top of the applet. You can use "Example1" whether or not you use "Example". However, to use "Example2", you must also use "Example1". To use "Example3", you must also use "Example2". And so forth. The value should be a string that contains a ";". The part of the string before the first ";" appears in the example menu as a name for the example. The rest of the string is information needed for the example, such as the definition of a function. Each applet has its own definition for what options are allowed after the first ";".

The calculus applets provide specialized iteractivity customizable via applet params. Feel free to put them on your own web pages or make any other use of them. The following tables provides links to web pages that describe each calculus applet, its options and what it does.

ArcLength Area AveValue
BoxProblem DerivTable DiffEq
EqOfMotion FundamentalTheorem Improper
Integration IntGraph IntTable
IntTheorems Inverse KnownCrossSection
LHopital LinearApprox MeanValue
MidPointTrapezoid MotionOnLine MotionOnPlane
ParamDeriv PolarArea PowerSeries
Revolution SecondFundamentalTheorem Seq
Series SnowballProblem Substitution
Template Transform Velocitytable

Launch Button

Normally an applet is embedded in a web page. You can also include a button on a web page to launch an applet into a separate resizeable window. The following example shows the applet from the above example, configured to run in a separate window and set to use larger fonts and line widths.

<applet code="net.sourceforge.webcompmath.applets.LaunchButtonApplet"
codebase="../../assets" archive="webcompmath.jar,calculus.jar" height="40" width="160">
<param name="Class" value="net.sourceforge.webcompmath.calculus.ArcLength" />
<param name="ButtonName" value="Launch Presentation" />
<param name="FrameTitle" value="Arc Length" />
<param name="FrameSize" value="600,600" />
<param name="UseLoadButton" value="no" />
<param name="Presentation" value="yes" />
<param name="Example1" value="1. Standard;x^2;0;1;-1;2;0;false;-1.5,2.5,-1,5" />
<param name="Example2" value="2. Inverse;y^2;0;1;-1;2;1;false;-1,5,-1.5,2.5" />
<param name="Example3" value="3. Parametric;cos(t);sin(t);2;0;3.14159;2;false;-1.1,1.1,-0.5,1.35" />
<param name="Example4" value="4. Polar;th;0;4;0;6;3;false;-7,7,-6.53,6.53" />

The code attribute now specifies the LaunchButtonApplet, instead of the calculus applet that you want. The calculus applet name is specified in the Class parameter. The ButtonName parameter gives the title of the button shown on the web page. The FrameTitle parameter gives the title of the window that will be opened for the applet, and the FrameSize parameter gives the height and width of the window in pixels. The rest of the parameters are as described above. Note that the Presentation parameter is set to "yes" so that larger fonts and thicker line widths will be used.