The more things change the more they stay the same...I did a manual port of http://www.box2dflash.org/ to JS a few years back to make educational simulations:
http://schoolnotez.com/ http://appynote.com/app-store/ (see the pendulum example.)
good job.