Just a guess:
if a collide with b then:
vb=vb+( (va-vb) on (a to b) )*2*(mass a)/( (mass a)+(mass b) )
va=va+( (vb-va) on (b to a) )*2*(mass b)/( (mass b)+(mass a) )
va and vb is the movement vectors. I hope you know vector math
Anyway, just a wild guess ;)
Edit: Oh by the way, while I keep guessing, I guess this, if true, should only apply to completely hard balls, or circles in 2D.
if a collide with b then:
vb=vb+( (va-vb) on (a to b) )*2*(mass a)/( (mass a)+(mass b) )
va=va+( (vb-va) on (b to a) )*2*(mass b)/( (mass b)+(mass a) )
va and vb is the movement vectors. I hope you know vector math
Anyway, just a wild guess ;)
Edit: Oh by the way, while I keep guessing, I guess this, if true, should only apply to completely hard balls, or circles in 2D.