Important Formulas in This Chapter

The important formula in this chapter is the one for conservation of momentum.

Conservation of momentum, in straight mathematical terms:

 (m0  m1) * v0 + 2 * m1 * v1 v0Final = ----------------------------                  m0 + m1           (m1  m0) * v1 + 2 * m0 * v0 v1Final = ----------------------------                  m0 + m1 

Conservation of momentum in ActionScript, with a shortcut:

 var vxTotal:Number = vx0 - vx1; vx0 = ((ball0.mass - ball1.mass) * vx0       + 2 * ball1.mass * vx1) / (ball0.mass + ball1.mass); vx1 = vxTotal + vx0; 


Foundation ActionScript. Animation. Making Things Move
Foundation Actionscript 3.0 Animation: Making Things Move!
ISBN: 1590597915
EAN: 2147483647
Year: 2005
Pages: 137
Authors: Keith Peters

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net