http://www.livephysics.com/computati...functions.html