If you had a Java-aware browser,
this pendulum would swing.

by M. Gallant 10/96

Here is a simple swinging pendulum animation which you can use to visualize multi-tasking effects on your platform. For example, watch the pendulum slow down as you load your processor with more running applications. Watch the differences between Macs versus PCs versus SUNs. This simple-pendulum applet uses the linear harmonic equation to calculate dynamically the instantaneous position in the plane for a pendulum of length "length" and gravity "gravity" with update interval of "displayDelay" milliseconds. The animation time scale is correct for the physical parameters specifying this geometry.
The default values are :
Remember that the oscillation time of such a simple pendulum (ignoring air resistance etc.) only depends on the LENGTH and GRAVITATIONAL ACCELERATION, but not on the mass at the pendulum end. The pendulum swing time for these default parameters is 2.0 seconds in principle. The graphics display should be quite smooth (negligible flickering) on all platforms (except Mac) due to the use of image "double-buffering". Dynamic time adjustments are used (via calling the System.currentTimeMillis() method) to adjust the "clock" as it gets out of sync due to program run/draw delays etc. There are adjustment buttons to change the period of the pendulum by increasing/decreasing the pendulum length. The resultant image jumps are phase jumps.

The source code
(by M. Gallant 3/10/96)

Go Home ET