Home Store Project Ideas Project Guide Ask An Expert Blog Careers Teachers Parents Students

Getting Started with the Geometry Applet

Important: You will need the current version of Java installed on your computer for this project. If you do not have Java, some figures and images in this project may not display properly in your browser. To check for the current version of Java on your machine, visit Java.

What is the Geometry Applet? It is a very cool program written by Professor David Joyce to illustrate an online version of Euclid's Elements. The applet creates dynamic diagrams in which you can manipulate the geometric figures by clicking and dragging on points. You program the applet much like creating a geometrical construction by hand. As the points are dragged, all of the essential relationships in the diagram remain intact. It is an engaging and intuitive way to illustrate the generality of a proof. To see examples of the Geometry Applet in action, check out any of these three projects:

You can use the applet to create your own diagrams on your computer. The following instructions will have you working with the Geometry Applet in just three easy steps.

  1. Download the applet:
    1. Create a folder for working with the Geometry Applet.
    2. Click on the following link, and save the file "Geometry.zip" to the folder you just created: http://aleph0.clarku.edu/~djoyce/java/Geometry/Geometry.zip

  2. Create your first diagram:
    1. Open a text editing program. (For example, you can use the Notepad program that comes with Windows. We recommend not using a word-processing program, such as Word.)
    2. Copy and paste the following text (in blue) into your text editor:

      <!-- This paragraph is a "comment." When writing HTML, comments start with a less than sign, exclamation point, and two dashes just as you see at the beginning of this paragraph and they end with two dashes followed by a greater than sign. Everything in between is ignored by the computer (more specifically the Web browser) when it reads your file. Comments are used to describe your code so that you remember what each part does. -->

      <!-- Every HTML document starts with the HTML tag. Tags are instructions to the Web browser, and they are always contained between the characters < and >. -->
      <HTML>

      <!-- The HEAD tag identifies a chunk of material that does not appear in the main body of your page in the Web browser, but it is important nonetheless. -->
      <HEAD>

      <!-- The TITLE tag specifies the text that will go in the title bar at the top of the Web browser when it reads your file. It will also be used in bookmarks or hotlist entries. Change it and see what happens! </TITLE> must appear at the end of your text; </TITLE> is called a closing tag. Closing tags have a / character in front of the same code that was used in the opening tag. -->

      <TITLE>Perpendicular Lines Diagram with the Geometry Applet</TITLE>
      </HEAD>
      <BODY>
      <CENTER>
      <applet code=Geometry codebase="./" archive=Geometry.zip height=150 width=250>
      <param name=title value="Perpendicular Lines">
      <param name=align value="CENTER">
      <param name=e[1] value="A;point;free;40,110">
      <param name=e[2] value="C;point;free;210,110">
      <param name=e[3] value="AC;line;connect;A,C">
      <param name=e[4] value="B;point;lineSlider;AC,125,110">
      <param name=e[5] value="D';point;perpendicular;B,A;0;0">
      <param name=e[6] value="D;point;lineSlider;B,D',125,40">
      <param name=e[7] value="BD;line;connect;B,D">
      </applet>
      </CENTER>
      </BODY>

    3. Name the file "RightAngle.html" and save it to the same folder you created for the Geometry Applet.

  3. Open the file you just created ("RightAngle.html") with your browser program. In your browser, use the "File" menu, and choose the option "Open..." (for Firefox, choose "Open File..."). Navigate to your file and select it.
    1. After the applet starts up, you should see a diagram with perpendicular line segments, just like the one below (try clicking on a point and dragging):
    2. If you have problems, the following checklist should help to solve them:
      • Is your browser Java-enabled? If you cannot view and manipulate the figure in 3, above, then this is the likely problem.
      • Check to make sure that you followed the instructions in steps 1 and 2 exactly. The applet's zip file (Geometry.zip) needs to be in the same directory as the RightAngle.html file.

Congratulations! You have successfully installed and run the Geometry Applet on your computer.

The next page shows you how to start writing your own diagrams: Coding Your Own Diagram: Example 1.