(Note: code was never intended to be visible to the public, and this is old and bad. But hey, it works!)
http://kevingibbons.org/doublependulum.html