Sorry, your browser is not set up to run Java applets.
How to get a Java VM.

Tractrix Java Applet Class

Rated Top 25% WebApplet by JARS
This page documents Tractrix version 1.1.2. Last modified: 8 December 1998.

Page Contents On-site Links Off-site Links
Introduction Colour parameters PHD web site
Simple usage On Show at the Java Centre
Shape parameter
Corners parameter
Creep parameter
Other information
Version History
Tractrix is Copyright © 1996,1997 PHD Computer Consultants Ltd.
Until further notice, it is freeware, provided you email us to let us know that you are using it.

Download Unzip in a fresh directory.


Tractrix is a Java applet which makes the pretty swirling patterns that you can see on this page (assuming that you have Java running). The Tractrix pattern was named in 1692 by the Dutch mathematician Huygens.

Simple usage

Tractrix is very simple to use. You must specify the applet width and height.
Moving rectangle
<APPLET code=Tractrix width=30 height=30>
<PARAM NAME=cabbase>
Bullet shape
<APPLET code=Tractrix width=30 height=30>
<PARAM NAME=cabbase>
<PARAM name=shape value=bullet>


All the following parameters are optional.
Parameter Type Description Default
RGB triplet or colour name The background colour white
corners string One or more sets of coordinates to define the shapes to draw. none
creep One, two or three integers Defines how the tractrix moves: see creep parameters below. "2,10,2"
delay integer The delay in milliseconds between shape changes; must be at least 50ms. 500ms
RGB triplet or colour name The foreground colour black
shape string The shape name rectangle
If the shape name is given then the corners parameter is ignored.

For fancy patterns, do not specify a shape name, but detail the base shapes in the corners parameter.

Shape Parameter

Specify one of the following shape names. Each shape always fits the available window.
Rectangle Rectangle
Bullet or BulletR Triangle pointing right
BulletL Triangle pointing left
BulletU Triangle pointing up
BulletD Triangle pointing down

Corners Parameter

The corners parameter has a list of the corners that make up the component shapes of the tractrix.

Specify coordinate pairs, delimited by the | character. Delimit shapes by a pair of | characters.

A simple rectangle is therefore "| 0,0 | 0,100 | 100,100 | 100,0 | while two rectangles is "| 0,0 | 0,100 | 100,100 | 100,0 || 100,0 | 200,0 | 200,100 | 100,100 |.

Within limits, there can be any number of points in a shape.

Note that position 0,0 is in the upper left hand corner of the applet area, the x axis extends right and the y axis extends down; all values should be positive.

Creep Parameter

The creep parameter specifies how the tractrix changes shape.

The current creep value indicates how far the interior shape moves within an outside shape. A small creep value makes for a dense shape, while a large creep value is an open shape.

The creep parameter is one, two or three parameters giving the minimum, maximum and increment between creep values.

So "2,20,1" specifies that the creep should start at 2 pixels, go up to 20 pixels in 1 pixel increments, then go back down to 2, etc., etc.

Typically the maximum creep parameter should be no more than a third of the smallest shape side size.

For a tractrix that does not move, make the increment zero; the maximum is then ignored.

Other Information

Clicking anywhere in the applet displays information about Tractrix.

The routines getAppletInfo() and getParameterInfo() are implemented.

Version history

1.1.2 Uses PHDUtils Java class.

PHD Home page.

PHD Computer Consultants Ltd makes no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. PHD Computer Consultants Ltd shall not be liable for any damages suffered by a user as a result of using, modifying or distributing the software or its derivatives.