# Script Tutorial for Geometer's Sketchpad

This page contains instructions for creating and running a script in Geometer's Sketchpad. The script we make will construct the circumcircle of a triangle. I recomment that you start Sketchpad and carry out the steps are you read this document.

We will use the following steps:

Many of the errors made by new users of the Sketchpad program involve the selecting of objects, so in the steps below I refer frequently to which items are selected at that time. If you have trouble with any of the steps, the first thing you should do is check to see that the correct objects are selected.

Construct Triangle

1. The easiest way to construct a triangle is to put three points in the sketch and select all three. When you create a point with the point tool it is selected. If you hold the shift key when you create another point, then both points will be selected. If you create the second point without holding the shift key, then the second point is selected but the first is not. So, create three noncollinear points while holding the shift key and they will all be selected.
2. Click the Construct menu and select Segment, as in the picture below.

Construct Circumcircle

1. There is a unique circle, called the circumcircle, that passes through all three points of our triangle. The center of the circumcircle, called the circumcenter, is the point of intersection of the three perpendicular bisectors of the triangle segments. We construct the circumcenter by constructing the perpendicular bisectors of any two segments in our triangle and constructing their intersection point. If you have just completed the triangle constructions as described above, then all three segments are currently selected. Clicking with the arrow tool away from the drawing will unselect everything. Now select one of the segments and in the Construct menu select Point at Midpoint.
2. The midpoint is now selected. Hold the shift key and select the segment that contains the midpoint. Since you held the shift key, the segment and its midpoint are now selected. In the Construct menu select Perpendicular Line. You have just constructed the perpendicular bisector of one side of the triangle.
3. Select another side of the triangle and repeat steps 1 and 2 to construct its perpendicular bisector. The picture below shows the triangle with two perpendicular bisectors.
4. Select the two perpendicular bisectors, pull down the Construct menu and choose Point at Intersection. This point is the circumcenter.
5. The location of the circumcenter is determined by the two perpendicular bisectors, so we cannot delete them from the sketch, but want to hide them and the midpoints to keep the sketch from getting cluttered. Select the two perpendicular bisectors and the two segment midpoints. From the Display menu, choose Hide Objects.
6. Now we construct the circumcircle by first selecting the circumcenter, then selecting any one of the triangle vertices. The order in which these points are selected does make a difference. From the Construct menu, choose Circle by Center and Point, to produce a picture like the one below.

Make Script

1. To make a script that will perform this construction, we first select all the objects. You can do this from the Edit menu with Select All, or you can use the arrow tool to drag a box around all the objects in the sketch.
2. From the Work menu choose Make Script.
3. You now have a second window (Script01.gss in the picture above). The script you have made contains the steps you carried out to construct the circumcircle of a triangle, and you can use the script to repeat those steps on any triangle. Notice that the script window is highlighted. Click in the sketch window to highlight it and bring it to the front. Now click the X in the upper right hand corner of the SKETCH window to close it. You do not need to save this sketch.

Run Script

1. Now open a new sketch window by going to the File menu and choosing New Sketch.
2. Create three noncollinear points in the new sketch window and select all three, as in the picture.
3. Bring the script window to the front by clicking on it, and then click PLAY. You see the steps of your construction carried out on the three points. If you had clicked FAST instead of PLAY, the steps would have been carried out quickly.

I hope that you now have the confidence to try some other constructions and make scripts to repeat them. I have not discussed saving your script, because the way that you can save your work depends on what machine you are using. Version 3 of Geometer's Sketchpad allows you to execute a saved script at the click of the mouse with Script Tool. This is a very handy feature that you can is described in the online help. (Look under Help/Scripts/Script Tools.)

This is my first attempt at writing a Web tutorial, and I would appreciate hearing you comments and suggestions. You can send me email by clicking on the address below.

Jeff Brown

brownj@cms.uncwil.edu