We explain how to create a Java applet using Geometer’s Sketchpad (GSP) and Java Sketchpad (JSP). The applet described below will demonstrate how the graph of y=ax
2 changes as a changes.In this tutorial one always "selects" objects by left-clicking on them.
Menu bar options will appear in the text within angled brackets
(i.e. <File>). Selections from a menu will be in boldface (i.e. Save).
1. Start a new sketch.
2. Under <Graph> choose Create Axes
3. Select the x-axis and under <Construct> choose Point on Object.
4. Choose the "hand" ![]()
This will show the current (GSP generated) label. Now double click
on the label. This will bring up a window that will allow you to
re-label the point with something more meaningful like "x".
5. Select the new point (x) and under <Measure> choose Coordinates.
This will display the coordinates of that point on the sketch.
6. Choose the "segment"
on the left tool bar. Click and drag
to create a two inch (or so) vertical segment on your sketch.
7. Choose the "arrow"
on the left tool bar.
8. Select the segment and under <Construct> choose Point At Midpoint.
9. As in step 4 re-label this point "0".
10. Select the segment and under <Construct> choose Point on Object.
11. As in step 4 re-label this point "p".
12. Select the point labeled "p", then under <Measure> choose
Coordinates.
13. Select the point labled "0", then under <Measure> choose
Coordinates.
14. Under <Measure> choose Calculate.
15. Click on the coordinates of the point "p" (a drop-down menu will
appear) and choose "y" (y_p will appear on the calc). Then choose ok.
16. Under <Measure> choose Calculate.
17. Click on the coordinates of the point "O" (a drop-down menu will
appear) and choose "y" (y_O will appear on the calc). Then choose ok.
18. You will now have the y-coordinate of both the point "p" and the point "O" on the sketch.
19. Under <Measure> choose Calculate.
20. Click on the y-coordinate of the point "p" (an y_p will appear on the calc), choose the - (for subtraction), then choose the y-coordinate of the point "O" (an y_0 will appear on the calculator). Then choose ok.
21. There will now be the measurement
y_p-y_O on the sketch. Choose the re-labeling button
and double click on the y_p-y_O measurement. A format window will appear
choose the "Text Format" radio button. Then replace everything
on the left with a =. Then choose ok.
22. Under <Measure> choose Calculate.
23. Click on the measurement "a" (an a will appear on the calculator).
24. On the calculator choose * (for multiplication).
25. Now click on the coordinates of the point "x" created in step 3 (again on the
drop-down menu) choose "x" (x_x will appear on the calc).
26. On the calculator choose ^.
27. Then on the calculator choose 2 and then choose ok.
28. Click on the coordinates for x and again on the drop-down
menu choose "x" (x_x will appear on the calc). Then click ok.
29. Now Select the x-coordinate of x (that you just created) and with the
shift key depressed also click on the expression for a*x_x^2.
The order here is important.
30. Under <Graph> choose Plot as (x,y). (Notice if you move the point
labeled "x" or the point labeled "p" the new point moves.)
31. Select the point just plotted and with the shift key down select
the point labeled "x".
32. Under <Construct> choose Locus. (This should create a parabola).
33. Now with the shift key depressed select all the objects you
don't want to see and under <Display> choose Hide Objects or
Hide Points or Hide whatever was selected. It is important to hide these objects and not delete them.
34. Now change the label of the point "p" to "a".
35. Name it and Save it.
You have created an interactive sketch that allows the user to drag the point labeled "a" and observe the change in the graph of y=ax
2.Now we describe how to transfer this GSP sketch to an interactive Java applet to display on your website.
1. After you have downloaded and installed Java Sketch Pad run the executable called gsp_html.exe.2. A window will open that asks you to open a GSP file.
3. Select the GSP sketch you would like to convert.
4. Your sketch will open in a window that looks like GSP.
5. Adjust the window to show the portion of the sketch you would like
users to see.
6. Under <File> choose Save As HTML….
7. You will now have an HTML file containing your Java applet.
I typically use Front Page or some other HTML editor to make minor changes in this file. Using the construction grammar found on the JSP website one can alter location of objects, color of object, size and color of text, background color, gridline color, and much more. In fact it is possible, using the construction grammar, to create an entire applet from scratch without using GSP at all.