Use the tab key to clear the time and phase graphs. Use the spacebar to start andt stop the applet.

JavaScript Examples

Applet Interface

Pendulum may be embedded within a web page with the following HTML tags:

<applet code="Pendulum.class" width=700 height=360>
<PARAM NAME="initTheta" VALUE=3.1>
<PARAM NAME="initOmega" VALUE=0>
<PARAM NAME="drag" VALUE=0.1>
<PARAM NAME="freq" VALUE=0.63>

Initial angle and inital omega are in radians and radians/sec, respectively. Freq is the driving frequency. Drag and amp are measured in scaled units. (See Pendulum_PHYS.) All parameters have default values. You may need to adjust frames per second, fps, to obtain smooth animation on slow machines.

Pendulum may be scripted using the following Java method calls:

Use the codebase tag if the Pendulum.class file is in a different directory than the HTML page that uses the applet. (See source for this page.) All Java packages used by Pendulum, such as the graph package, must be in subdirectories below the Pendulum.class file. may be downloaded for noncommercial use by students and faculty at accredited not-for-profit educational institutions. The zip file being distribted is uncompresssed. It can be used with the new Netscape Archive tag. (See source code for this page.) The archive tag allows Netscape to download all the necessary files with a single HTTP request to the server. It is much faster than the standard download method which requires a HTTP request for each file. You should, however, keep copies of the uncompressed class files in the class directory so that browers that do not support the archive tag will be able to run the applet.

Pendulum was written using Java 1.01. It will be rewritten as a Java "Bean"using the newer (and better) Java event model avaliable in Java 1.1.