Please check out [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=614.0]Spring + Pendulum [/url]