Some of my Programs

Here are a few simple programs of my own. These mostly relate to the study of pattern generation, image processing or something for my kids to play with!

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Spirolateral

Spirolaterals are figures formed by repetition of a simple rule. By drawing line segments of increasing length (in integral units) and turning a fixed angle after each segment (clockwise or anti-clockwise) and stopping when the figure so created returns to its starting point (or it becomes apparent that it will never do so) yields a surprisingly rich family of figures. A few examples can be found at MathWorld, and a much more in-depth discussion at BitArt and in this paper.

I wrote the following small program quite recently, both to explore this fascinating algorithm myself, and also for my kids to play with. I also wanted it to develop it on the oldest hardware practical, so after an aborted attempt using MDS on a 512K, I wrote it with LightSpeed C version 2.01 on a Mac Plus. Because of this, it has only a very simple interface, as seen in the following image.

.

download

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Funny Faces

Using the same basic template as for the Spirolateral program, I also wrote the following program for my kids to explore "Chernoff Faces". Chernoff faces were developed as an aid in interpreting multidimensional data (Herman Chernoff, "The Use of Faces to Represent Points in k-Dimensional Space Graphically", Journal of the American Statistical Association, 1973), but are also fun to play with for their ability to easily capture a wide range of facial expressions. I first learned of them from an article in the Spring 1991 issue of Develop (the Apple Technical Magazine). By defining a face according to a vector of values between 0 and 10, each describing deviation of some feature from a neutral middle point (i.e. a value of 5), simple cartoon-like faces can be drawn that exhibit a substantial range of expressions. Of particular interest is the comparison of any face with its "inverse" - that is the face constructed by reversing the deviation of each feature, as seen in the following pair:

.

The application allows manipulation of each feature individually or all features together, by increasing, decreasing, resetting, randomising or reversing. It sure makes for a lot of buttons!

download

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Image

This next program is a simple program I wrote for students of a Summer School at which I was invited to teach, that illustrated and allowed experimentation with some basic image processing techniques. Using only simple raw greyscale images (several samples are provided), it supports various standard operations and illustrates their effect by showing the original and processed images side by side, as well as displaying the histogram of grey levels.

.

The particular image processing options supported can be found in the Process menu.

.

download

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Automata

This program was my first publicly released piece of Macintosh software - released as freeware in 1993. I had long been fascinated by the pattern generation properties of cellular automata, specifically with respect to the generation of large scale structure by small scale interactions.

Growing from a single seed, this run shows how a simple nearest neighbour rule can generate the fractal known as a Sierpinski Gasket.

.

Now allowing two values per site and both nearest and next-nearest neighbours to influence the evolution, the following pattern is grown from an initial random configuration.

.

The program includes moderately detailed help describing cellular automata in general, and the various options available. The rule entry screen may well hold the record for the most radio buttons on a single dialog ever!

.

download

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Moon

While working in physics, I spent a lot of time studying equations describing nonlinear dynamical systems. Upon switching to Computer Science, visualising these systems seemed like a reasonable project to start off with, and so I developed the program "Moon" (named from the Thai word for "spin"). Moon allowed plugging in the code for various systems of equations, and visualising them in 3D (using a virtual-sphere controller to manage the rotation). Some of the nicer features were the ability to look at any particular 3D projection if the system was in 4 or more dimensions, plus dynamic features such as tracing the evolution and animating the attractor through all dimensions.

The following sample shows the view for the famous "Butterfly" attractor.

.

download (Requires 68K + FPU or PPC)

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home

Vigilante

To avoid the restrictions placed on me by a local firewall while living in a university college, I employed a simple SOCKS server on an appropriate machine. However, the SOCKS server software was somewhat unstable and would crash a little too frequently. So I wrote "vigilante", a small application that watches other applications are restarts them when they close (or crash). With vigilante watching the SOCKS server, the situation was much improved and I was rarely stranded.

Using vigilante is simply a matter of starting it up and adding whatever applications need to be monitored to a list. If running, they will be watched. If not running, they will be launched and watched.

download (requires System 7)

Thai clock

After graduation, I spent a year teaching physics at the Prince of Songkla University in Southern Thailand. This tidbit grew from my efforts to use Thai characters on the Macintosh.

.

I had hopes of making it talk in Thai as well, but simply never got around to it.

download

Spirolateral | Funny Faces | Image | Automata | Moon | Thai clock | Vigilante | Software | Home