Here is my code for the planet simulation. The struct xyvect, declared at the top of the file, uses arithmetic operator overloading. It could be placed in a separate file if required. ------------------------------- George Saklatvala Room 821/823 Rutherford Building, Cavendish Laboratory, J. J. Thomson Avenue, Cambridge CB3 0HE. Telephone: (+44) (0)1223 766468 Fax: (+44) (0)1223 354599 ------------------------------- David MacKay enhanced this example by rewriting the angular momentum function J().