The Geometry Applet

java applet or image

*** If you can read this, you're only seeing an image, not the real java applet! ***

I began writing this applet in Feb. 1996, and it's still under development, and probably will be until I get tired of modifying it.

I'm using it to illustate Euclid's Elements. Above you see an illustration from Euclid's Elements Book I Propostion 22.

Another example using this Geometry Applet illustrates the Euler line of a triangle.

I'm still developing the Geometry Applet on which the figures in the Elements are based, and there will be changes needed in it. The most recent is a way to lift the diagram off the page into a separate window.

Here's how you can manipulate the figures that appear. If you click on a point in the figure, you can usually move it in some way. The free points, colored red, can be freely dragged about, and as they move, the rest of the diagram (except the other free points) will adjust appropriately. Sliding points, colored orange, can be dragged about like the free points, except their motion is limited to either a straight line or a circle, depending on the point. If you drag the pivot point, colored green, the entire diagram will be translated along with it. Other points can be dragged, too, if there is a pivot point showing, and the diagram will be rotated and dilated around the pivot point. Also, if you type r or the space key while the cursor is over the diagram, then the diagram will be reset to its original configuration. If you type u or return the figure will be lifted off the page into a separate window. Typing d or return while the cursor is over the original window will return the diagram to the page. (Netscape has some problems getting it back into the right position.) Note that you can resize the floating window to make the diagram larger.

It needs a lot of documentation, and I'll get to that. Soon, I hope. Note that if you type any key while the cursor is over the diagram, then the diagram will be set to its original configuration.

Parameters:

Elements

The format for an element is a little complicated. Here's the specifcation for a typical element:
name=e[1] value="A;point;free;50,50;black;magenta"
Each element has a number, a name, an element class, a construction method, and construction data. Optionally colors may be specified. The number of this element is 1, which means that it is the first element to be created. Its name is A. Its class is point. Its construction method is free, which means it can be freely dragged about. Its construction data is 50,50, which means that it will be initially places at pixel coordinates (50,50). When it is displayed, its name A will be colored black, but the dot representing the point will be magenta.

Elements come in five different classes: point, line, circle, polygon, and sector. Each of these classes has several construction methods. Most of the construction methods can only use one list of construction data, but some can use alternate lists.

Element class point
Construction method Construction data Description
free 2 integers a freely dragable point with initial coordinates
midpoint 2 points
line
the midpoint C of a line AB
intersection 4 points
2 lines
the intersection E of two lines AB and CD
first line the first end A of the line AB
last line the last end B of the line AB
center circle the center of a circle
lineSlider 2 points, 2 integers
line, 2 integers
a point that slides along a line AB with initial coordinates
circleSlider circle, 2 integers a point that slides along a circle with initial coordinates
circumcenter 3 points the center of a circle ABC passing through 3 points A, B, and C
vertex polygon, integer a vertex Ai of a polygon A1A2...An with index i
foot 3 points
point, line
the foot D of a perpendicular AD drawn to a line BC
cutoff 4 points
2 lines
the point E on a line AB so that AE = CD
extend 4 points
2 lines
the point E on a line AB so that BE = CD
parallelogram 3 points
point, line
the 4th vertex D of a parallelogram ABCD given 3 vertices A, B, and C
similar 5 points
line, 3 points
the point F so that triangle ABF is similar to CDE
perpendicular 2 points
line
the point C so that AC is equal and perpendicular to AB
proportion 8 points
4 lines
the point I on GH so that AB:CD = EF:GI
invert point, circle the image of a point A inverted in a circle
meanProportional 6 points
3 lines
the point G on EF so that AB:CD = CD:EG

Element class line
Construction method Construction data Description
connect 2 points the line AB connecting two points A and B
angleBisector 3 points the line AD bisecting angle BAC with D on BC
angleDivider 3 points, integer the line AD with D on BC so that BAD is the nth part of the angle BAC
foot 3 points
point, line
the line AD drawn perpendicular to BC
chord 2 points, circle
line, circle
the intersection of a line AB in a circle
bichord 2 circles the common chord connecting the two intersections of circles
perpendicular 2 points
line
the line AC equal and perpendicular to AB
cutoff 4 points
2 lines
the line AE equal to CD along the line AB
extend 4 points
2 lines
the line BE equal to CD so that A, B, and C are collinear with B between A and C
parallel 3 points
point, line
the line AD parallel and equal to BC
similar 5 points
line, 3 points
the line AF so that triangle ABF is similar to CDE
proportion 8 points
4 lines
the line GI along GH so that AB:CD = EF:GI
meanProportional 6 points
3 lines
the line EG along EF so that AB:CD = CD:EG

Element class circle
Construction method Construction data Description
radius 2 points
line
the circle with center A and radius AB
3 points
point, line
the circle with center A and radius BC
circumcircle 3 points the circle passing through 3 points A, B, and C
invert 2 circles the image of the first circle inverted in the second

Element class polygon
Construction method Construction data Description
square 2 points
line
the square ABCD on a side AB
triangle 3 points the triangle ABC given 3 vertices A, B, and C
quadrilateral 4 points the quadrilateral ABCD given 4 vertices A, B, C, and D
pentagon 5 points the pentagon given 5 vertices
hexagon 6 points the hexagon given 6 vertices
equilateralTriangle 2 points
line
the equilateral triangle ABC on a side AB
parallelogram point, line
3 points
the parallelogram ABCD given A, B, and C
regularPolygon 2 points, integer
line, integer
the regular polygon on a side AB given the number of vertices n
starPolygon 2 points, 2integers
line, 2 integers
the star polygon on a side AB given the number of vertices n and the density d
similar 5 points
line, 3 points
the triangle ABF similar to CDE
application polygon, 3 points given points B, C, and D, the parallelogram equal to the given polygon with one side BC and one angle BCD

Element class sector
Construction method Construction data Description
sector 3 points the sector of a circle given the center and two points on the circumference
arc 3 points the sector of a circle whose arc passes through three points

Source files

The Geometry Applet uses a Slate Canvas put all the Elements on. The slate can be lifted off into a separate window, and that uses ClientFrame, a subclass of Frame. An Element is a generic thing which is subclassed in five different ways to give actual elements that can be displayed. These five classes are further subclassed, too


David E. Joyce
Department of Mathematics and Computer Science
Clark University
Worcester, MA 01610

Email: djoyce@clarku.edu
My nonJava Homepage and my Java homepage