# Sphere-to-Sphere Momentum After Collision

## Recommended Posts

Hi, I was wondering if someone could help me out? I'm making a basic physics simulation with bouncing balls, treating them as particles so I dont need to take rotation and friction into account. My current method for sphere-to-sphere collision response is as follows:
        //Find the line of impact
Vector3f normal1 = ball->Position() - ball2->Position();
normal1.Normalise();
Vector3f normal2 = Vector3f(normal1.ScaledBy(-1));

//VR = VI – 2(VI.N)N
Vector3f refVel1 = (normal1*((1+eCof1)*(-initVel1.Dot(normal1))))+ initVel1;
Vector3f refVel2 = (normal2*((1+eCof2)*(-initVel2.Dot(normal2))))+ initVel2;


So all it'd doing is finding the line of impact between the 2 balls and reflecting their velocities around this line. The eCof value is the coefficient of elasticit of the ball. Each ball also has a mass value so I would like to add this into the equation, but I'm not sure how. I know that momentum is only conserved along the line of impact and I know that the total momentum before and after the collision is the same, but I dont know how much momentum is transfered. Does any one know how to do this, any help would be much appreciated. I have made another method trying to do this which didnt work that I could post as well if it would be any help.

##### Share on other sites
starting from scratch, without your current thinking.
represent the new velocities using an impulse as:

v' = v + jn/m
q' = q - jn/w

with the impulse magnitude j, and the masses m,w, and normal of interaction n (n being a unit vector)

conservation of momentum is then:

mv + wq = mv + jn + wq - jn
0 = 0

so momentum is conserved already.

the other equation involves the coeffecient of restitution which is:

(v'-q').n = -e(v-q).n

with coeffecient of restitution e for the collision (since your two balls have their own coeffecients of elasticity, i'm not exactly sure how to combine them, but multiplying them may be correct, i'm not sure)

you then have:

(v + jn/m - q + jn/w).n = -e(v-q).n
(v-q).n + j(1/m + 1/w) = -e(v-q).n
j(1/m + 1/w) = -e(v-q).n - (v-q).n
j/(1/m + 1/w) = -(1+e)(v-q).n

j = (-(1+e)(v-q).n) / (1/m + 1/w)

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627682
• Total Posts
2978622

• 9
• 14
• 12
• 10
• 12