Webcompmath Project

Configurable Webcompmath 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.

A set of thirteen configurable webcompmath applets is available. Note that there are no restrictions on using these applets. Feel free to put them on your own Web pages or make any other use of them. Each applet has its own Web page, where you will find examples of using the applet and information about the applet params that can be used to configure it. All the applets except "Evaluator" and "ScatterPlotApplet" share a large number of params, which are described in the file Generic-params.html. Here are links to the web pages for the individual applets:

Evaluator SimpleGraph FamiliesOfGraphs
MultiGraph AnimatedGraph Parametric
EpsilonDelta Derivatives SecantTangent
RiemannSums IntegralCurves FunctionComposition
ScatterPlotApplet Continuity FunctionCombination

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

 <applet archive="webcompmath.jar" code="net.sourceforge.webcompmath.applets.SimpleGraph.class"
width=300 height=300>
<param name="UseFunctionInput" value="no">
<param name="ShowPoint" value="no">
<param name="UseLimitsPanel" value="no">
<param name="Example1" value="The function trunc(x); trunc(x); -7, 7, -8, 8">
<param name="Example2" value="Truncing a parabola: trunc(x^2); trunc(x^2); -5 5 -2 20">
<param name="Example3" value="x^2 - trunc(x^2); x^2-trunc(x^2); -3 3 -3 3">
<param name="UseLoadButton" value="no">

This example is for the SimpleGraph applet. The first line specifes the applet class file, "SimpleGraph.class", that is to be executed, and the size of the applet on the page: width = 300 pixels and height = 300 pixels. It also specifies that the class file and any other class files that it references are to be found in the file webcompmath.jar, which is in the same directory as the Web page. If you want to use the configurable applets on your own web pages, you should download the file webcompmath.jar. You don't necessarily have to put it in the same directory as the web page. You can put it in a different directory and use a relative path to the file. For example, archive = "../webcompmath.jar" says that the jar file is in the parent directory of the directory that contains the Web page. This can be useful if you have several Web pages in different directories -- you will still only need the one jar file. 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 sample applet tag defines several params. Each param is defined in a param tag which gives its name and value. To learn about the available param names and their meanings, see the pages for the individual applets and the list of common params on the page Generic-params.html.

Expressions in Webcompmath

All the applets work with "expressions" such as "x+3" or "sqrt(k*t)". Expressions can use the operators +, -, *, /, ^, and ** (where both ^ and ** indicate exponentiation), and they can use the mathematical constants pi and e. They can use various mathematical functions: sin, cos, tan, sec, cot, csc, arcsin, arccos, arctan, exp, ln, log2, log10, abs, sqrt, trunc, round, floor, ceiling, and cubert. (Here, "abs" is the absolute value function and "cubert" is the cube root function.) There are a number of optional features. An option that is on by default is the use of C-style conditional expressions such as "x<y? x : y", which means "if x<y then x otherwise y". Options that can be turned on include: Allow multiplication by juxtaposition instead of requiring the * operator; make the parentheses around a function argument optional; allow the factorial operator, as in "n!"; and allow summations such as "sum(i,1,5,x^i)", which means "the sum of x^i for i from 1 to 5". It's possible to add new functions. For example, if you would like to have a function named "log" which you think should be the same as the common logarithm function, you can define it yourself in terms of the built-in function ln(x). It is even possible to define a function by giving a table of (x,y) points that lie on its graph. You'll can enable options and add functions using applet params.


If you interested in programming your own configurable applets, you should look at the JavaDoc documentation for GenericGraphApplet. This is the base class for most of the configurable applets, and you can use it as a basis for your own applets if you want. You can also browse the source code for the thirteen applets on-line.