Applet Syntax


The applet is embedded in a html document in the following way:

<applet codebase=../classes/ code=GraphApplet.class width=260 height=260>
<param name=function1 value="3*x^2">
<param name=....>
<param name=....>

codebase represents the location of GraphApplet.class relative to the calling document.
width and height specify the width and height in pixels of the resulting graph.
The applet has the following interactive features:


<Param name=speed value=positive integer>
The speed parameter tells GraphApplet how much pixels to the right it should advance to calculate the next point of the graph; when omitted the default value 4 is taken.
When plotting very smooth curves a higher value can be chosen. When necessary the minimum speed of 1 can be chosen, e.g. when plotting functions like y=sqrt(x) or functions with discontinuities

<Param name=labels value=yes/no>
When set to 'yes' a label is constructed from the functionstring. This label is displayed when a text-string for this function is absent. The default value is 'no'

<Param name=grid value=yes/no>
When set to 'yes' a grid is shown. Default value is 'no'

<Param name=help value=yes/no>
When set to 'yes' the help-screen is shown when calculating the graph for the first time. The help-screen remains available by pressing the help button. Default value is 'yes'

<Param name=maxx value=positive integer>
Sets the maximum value of x. The minimum value is automatically -maxx. The default value is 10.

<Param name=maxy value=positive integer>
Sets the maximum value of y. The minimum value is automatically -maxy. The default value is 10.

<Param name=functioni value=function string [;parameterlist]>

Up to five functions can be plotted in one graph; they are numbered function0, function1...function4. Only one of these five need be present. The functions are plotted according to the following color scheme: function0: black; function1: red; function2: blue; function3 : magenta; function4: green.

A full example of a function is: <Param name=function0 value="a*x^2+b;a=1,2;b=1,2,3>

<Param name=texti value=text>
When present it overrides the label constructed from the function string. Is shown whatever the state of the parameter labels.

<Param name=points value=[text],x(double),y(double),pos(1..9),color(0..4)[;........]>
Makes it possible to display a dot and a text at a chosen position in the plane.
x and y govern the position of the dot that is drawn;
pos governs the position of the text with respect to the dot, according to the following scheme:

So pos=3 draws the text north-east of the dot. At position 5 no dot is drawn but only the text;
To display a dot without text, omit the text but don't forget the comma: so value=",1,2,7,1" will display a dot at position (1,2) on the screen with color 1;
The colors available are the same as the colors functions are drawn with: 0:black; 1:red; 2:blue 3:magenta 4:green
As many points can be drawn as wanted by separating them with semicolons (;).
Because the syntax of this parameter is somewhat tricky in case of an error a reminder is shown on the status line.