The author Jared Tarbell is a smart Flash programmer. My respect on him is endless, so that a space about his (master)pieces on my website is almost mandatory. The algorithms are basically developed on matematics and mechanical laws.

Moreover, his own simulations are Open Source and downloadable for free on www.levitated.net (Flash plugin needed).

Last but not least: some visualization issues could exist in IE browser.
By me, a proper switch to other browsers like Opera as well as Firefox is recommended.
More Flash experiments are available for free at the owner's site. Some of them are simply amazing. Here are those I like most.