# Lite Applets - Using a Lite Applet with a Spreadsheet or Computer

Author(s):
Frank Wattenberg, Bart Stewart, and Suzanne Alejandre

This live image looks very similar to the one in the preceding section except that, by changing a few of the parameters calling the applet, we have created three new buttons that enable the user to copy data into a spreadsheet (or a computer algebra system). In this form, the Image_and_Cursor applet might be used in a module that would lead students to discover how to estimate the length of a complicated curve, such as the border between Afghanistan and Iran. If you have Excel or another spreadsheet on your computer, you might try this:

• First move this window over to the right side of your screen to free up one or two inches of space at the left of the screen.

• Next launch your spreadsheet with a blank worksheet. Position the spreadsheet at the left of the screen. Your screen should look something like the following picture, with the spreadsheet window peeking out from behind this browser window.

• Now mark a series of points along the border between Afghanistan and Iran by positioning the cross hairs at each point in turn and clicking the Mark point button.

• After you have marked a series of points along the border, click the List points button.

• In a few seconds a new window will appear with the coordinates of the points you marked. (If necessary, enlarge the window so you can see the coordinates.) Move this window to the right so that it does not obscure the spreadsheet window peeking out from behind the browser window.

• Now highlight the data in this window in the usual way, by clicking and dragging or by using a combination of clicking and shift-clicking.

• The next step is to copy-and-paste the highlighted data into the spreadsheet. The way in which this is done depends on your operating system. You may be able to simply drag the highlighted data into the spreadsheet, or you may have to copy it using either control-c (Windows) or command-c (MacOS) and then paste it using either control-v (Windows) or command-v (MacOS). You can also copy-and-paste using the right mouse button and pop-up menu on Windows machines.

• Once you have the data in your spreadsheet you can compute the length of each segment of your polygonal approximation to the border. Then compute the sum of the lengths. Finally convert the length of the border measured in pixels into either miles or kilometers, using the scale on the map.

The Border Between Afghanistan and Iran is a student-ready module using this image and applet as we have just described.

The HTML code shown here illustrates how the Image_and_Cursor applet is called on this page. There are just a few changes from the applet call in the preceding section.

• The parameter display_sw now has the value 1 to specify the inclusion of the three buttons at the right enabling the user to record and display data. (Note: "sw" is an abbreviation for "switch".)

• The parameter cas_sw is set to the value 2, indicating that data should be displayed in a form suitable for a spreadsheet. Data can also be displayed in a form suitable for Maple or Mathematica.

• The applet width is larger to allow room for the new buttons.

To practice using the applet in this way, you will need to follow a procedure similar to that in the preceding section. First, you need two brief instruction pages:

• One-sheet instructions for using Image_and_Cursor with a spreadsheet or computer algebra system
• One-sheet instructions for this simplest use of the Image_and_Cursor applet -- you may have already downloaded this file when you read the previous page

Next, you need a copy of this page. [That link will open another copy of this page in a frame that will not include extraneous JOMA codes.] Right-click in the text of the new copy (command-click on a Mac), select View source (or equivalent), and save in the directory of your choice. Again, the code can be edited and saved in the application that opened it or in an HTML editor such as Dreamweaver or Front Page. Finally, you need the following files, and they should be placed in the same directory as the HTML page.

Now try creating your own student exercise with and image of your choice and a computational assignment that will make use of Image_and_Cursor data in a spreasheet or a computer algebra system.

The next section shows how lite applets can be used together with forms and Javascript to create even more interactive modules without writing Java programs.

## JOMA

Journal of Online Mathematics and its Applications