Javascript Versions of Popular Java Applets for Introductory Astronomy

These Javascript applets have been written at the Department of Physics and Astronomy of the University of New Mexico by Kevin Dilts. They are designed to replace Java versions of the same applets that we have been using in our introductory astronomy courses but which have become increasingly difficult to support.

The files are in a zip archive called The applets extract into one folder, with auxiliary .js files in subfolders called js and d3 that are called upon by most of the applets. So to ensure that they all work, keep this folder structure unchanged.

To run an applet in Windows, for example, just double-click on the html filename and it should open in your default browser. The applets have been tested in recent versions of Firefox, Internet Explorer and Chrome browsers.

These applets are provided free to the community but if you use them, please acknowledge Kevin Dilts and the University of New Mexico. The applets are as follows:

Calculate Your Weight on Other Objects (weightCalc.html)

This applet is a simple one that allows you to calculate your weight on other objects: the planets, Pluto, and a custom object where you can enter your own mass and radius (in Earth units). Just choose an object, or choose 'custom' and put in a mass and radius, then put in an Earth weight, and your weight on the other object will be displayed.

Retrograde Motion (retrograde.html)

This is a version of the Java applet created by the McGraw-Hill Companies. For the planets Venus, Earth, and Mars, it allows you to view the retrograde motion of any of these planets from any one of the others. You can also change the orbit radius of Venus or Mars to see the effect of orbit size on retrograde motion. There are a few other controls to explore.

Kepler's Second Law (kepler_2.html)

This is similar to the applet created by the University of Nebraska-Lincoln but with a few differences. It allows you to visualize Kepler's Second Law by sweeping out equal areas for a fixed time interval for any of the planets, Pluto, Halley's Comet, or a custom object. The planet is shown orbiting around a focus which represents the center of mass of a two-body orbit. By clicking anywhere in the image, an area is swept out, dictated by the location of the object when you clicked. By clicking at other times during the orbit, you can compare the swept out areas. You can control the time interval with the "sector size" slider. For a custom object, you can enter your own semi-major axis and eccentricity in the boxes and then click on 'enter'. The applet also continuously reports the object's distance from the Sun, it's current velocity, and it's maximum and minimum velocities over the orbit. There is also a slow motion control and a 'clear' button to erase all the sweeps.

Kepler's Third Law (kepler_3.html)

This applet is similar to a Java version created by JPL, and shows an animation of the orbits of the planets, Pluto, Eris, and Halley's Comet. By dragging the mouse you can change the viewing angle of the Solar System. If you have a mouse wheel, you can use it to zoom in and out. Alternatively, controls allow you to rotate and zoom the display. You can center the view on any of the objects, change the speed, and control which orbit paths and labels are shown.

Inverse Square Law for Light (luminosity.html)

This allows students to explore the inverse square law by taking simulated measurements of the apparent brightness of sources of three different luminosities at different distances from them. The sources' luminosities increase by factors of 10. Use the cursor to move the 'probe' to different distances from each source. The distance and apparent brightness (labeled 'intensity') are shown as you move the probe. By clicking anywhere within the grey circle surrounding the source, a point appears on the graph below it of intensity vs. distance from the source. The measurements have noise, which is very noticeable for the faintest source and not so noticeable for the brightest. The grey and black curves in each plot show inverse-square and inverse-linear relations, so students can discover which law fits the data better. For the faintest source, because of the noise, it is not clear which is better unless points quite close to the source are taken. Each plot can be cleared using the button at the bottom right. The applet can also be used to show that there is no directional dependence in the inverse-square law.

Eclipsing Binary Light Curve (eclipsingBinaries.html)

This applet shows light curves for eclipsing Main Sequence binary stars. One can control the spectral class of the stars, the inclination ('angle') and the binary separation (circular orbits assumed). You must click on 'enter values' for values you change to take effect. The light curve shows the relative brightness as a function of orbital phase. The temperature and radius of each star are also listed. The simulation can also be paused. Students can study the relative depth of the curves as a function of spectral class, the shape of total vs. partial eclipses, and eclipse duration.

Spectroscopic Binary (spectroscopicBinaries.html)

This is a version of the Java applet by Terry Herter at Cornell. The star masses can be set by typing in values (M2 is the more massive one – if you put in a higher value for M1 than M2, they will get flipped), and the semi-major axis, eccentricity, inclination, and azimuthal viewing angle of the orbit are controlled by sliders. You must click on 'enter' for values you change to take effect. In the plots, blue is used for the more massive star. A face-on view of the orbit is shown as well as the view for the chosen inclination and azimuthal angle (the orbit trails can also be turned off). A spectrum showing how absorption lines move back and forth in wavelength due to the Doppler Shift is shown, and a plot of the observed velocity of each star over a period. The period is also given. The speed of the simulation can be controlled. Can also be used to demonstrate finding extrasolar planets by the radial velocity method.

Simulated Evolution of a Cluster HR Diagram (hr.html)

This is a version of the Java applet created by R. Scharein at the University of British Columbia. It shows the evolution of a hypothetical cluster in the Hertzsprung-Russell Diagram. It does not show the complete post-MS evolution, but does demonstrate how the MS turnoff evolves with age. The simulation starts with 30 stars on the ZAMS. Their properties are based on the stellar evolutionary models from Schaller et al. (1992), with overshoot, "standard" mass loss, and no rotation. These have been interpolated to a finer mass grid, and the 30 stars are chosen at random from that grid. Click on 'Evolve' to start the simulation, 'Stop' to pause it, and 'Step' to increment by one time step. 'Reset' moves the time back to zero and a different set of 30 stars is displayed. The age of the cluster is displayed at the upper right. Timesteps increase in a nonlinear way. The 'Speed' slider actually controls how nonlinear this is. Clicking on a star at any time gives you its mass, luminosity, surface temperature, and MS lifetime. This applet reads the two excel files that are included in the distribution.

Milky Way Viewer (milkyway.html)

This applet allows you to view various structural components (Population I stars, Population II stars, the bar, open clusters, globular clusters, and HII regions or gaseous nebulae) of the Milky Way from any angle. Each is color coded and can be turned off and on with the menu at the right. The Sun is also shown with a large yellow dot. Drag with the mouse to change the viewing angle, or use the menu on the right. If you have a mouse wheel, it can be used to zoom in and out, otherwise there are controls for this. The structural components are only crudely represented, but give an idea of the vertical thickness of the Population II and globular cluster distributions, the concentration to spiral arms of the Population I stars, open clusters and HII regions, the approximate size, shape and orientation of the bar, the four-arm spiral structure as outlined by young populations, and the location of the Sun between major arms.