Home -> Workshops -> ICTCM -> Creating Applets -> Simple Graphing Applet

Simple Graphing Applet

Here is an example of the Simple Graph Applet in action. We can use it to graph and compare, for example, the following two functions:

f(x) = x sin(1/x)

f(x) = sin(x) / x

In other words, we can reuse the applet to handle all graphs of functions with on variable. Simple add it to a web page with the appropriate parameters, as in the following example:

<APPLET CODE="SimpleGraph.class" 
<PARAM NAME="function" 
       VALUE="if(x<0,sin(1/x),1-x^2)"> <PARAM NAME="xmin" VALUE="-1>" <PARAM NAME="xmax" VALUE="1>" <PARAM NAME="ymin" VALUE="-1.2>" <PARAM NAME="ymax" VALUE="2.2>" </APPLET> 

Click here for the source code ...


Bert G. Wachsmut
Last modified: 05/03/00