#### Archived

This topic is now archived and is closed to further replies.

# how to calculate the collision of the ball

This topic is 5654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how to calculate the collision of the ball when it is collided

##### Share on other sites
What kind of ball? Against what? Details, please...

It is coming...8 years in the making and It is finally coming...

-Beavt8r

##### Share on other sites
When the ball hits a wall that is parallel to one of the axis its quite obvious:

negate the according speed value.
example:
Ball with speed (vx, vy, vz) hits bottom or ceiling:

vy *= -1;

When a ball hits another ball, there are two cases:

1) central hit
2) decentral hit (as used in billard to do fancy shots)

Since the decentral hit obviously needs a doctorand in physics (as i was told) to be calculated, i'll just tell you the equitation for the central hit. (which still looks nicely)

Assume, that you have the vectors v1, v2 : (vx, vy, vz) which are the speed of the balls.
Further you have the masses m1 and m2 of your balls.
Then the new speed values are as following:

v1 = v1 * (m1 - m2) / (m1 + m2) + v2 * (2 * m2) / (m1 + m2);

v2 = v1 * (2 * m1) / (m1 + m2) + v2 * (m2 - m1) / (m1 + m2);

[edited by - Christian Schlager on January 29, 2003 4:01:27 PM]

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631782
• Total Posts
3002332
×