The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

three-body - Perl script to illustrate Math::RungeKutta

SYNOPSIS

 perl examples/three-body

DESCRIPTION

This script uses Math::RungeKutta integrate Newton's inverse-square law of gravity for three objects moving in a two-dimensional plane.

It uses rk4_auto to adjust the step-size automatically, and rk4_auto_midstep for a smoother display.

The display assumes you are running something sufficiently vt100-compatible to understand moveto and reverse. It looks best if you run a large square window with a tiny font, perhaps somewhere round 118x80.

You can experiment with changing the masses @m of the objects or their initial positions and velocities @y, and you will probably discover how sensitive three-body motion is, and explore some of the many things that can go wrong during numerical integration :-)

AUTHOR

Peter J Billam www.pjb.com.au/comp/contact.html

CREDITS

Based on Math::RungeKutta

SEE ALSO

examples/exponentials, examples/sine-cosine, Math::RungeKutta, Term::Size