Calculating Ball Speed and Direction After 2D Collision: Game Programming Tips

In summary: The equations are:m1v1i + m2v2i = m1v1f + m2v2f (conservation of momentum)m1v1i^2 + m2v2i^2 = m1v1f^2 + m2v2f^2 (conservation of kinetic energy)In summary, to determine the speed and direction of two balls after collision in two dimensional space, you will need to use the equations for conservation of momentum and kinetic energy for each ball in the x-axis and y-axis. This will depend on whether the collision is elastic or inelastic. These equations can be found on websites such as Wikipedia.
  • #1
Cruncher
5
0
Okay this is a question about after two balls collide knowing their speeds and directions and mass before collision, what is their speed and direction after collision in two dimensional space.


more specifically i need to know this because i am programming a game in which i need accurate ball behavior so, assuming collision occurs at the origin, and ball one comes from x degrees and ball 2 comes from x degrees, and i know their speeds, and can make up a mass for them based on their size,

how do i figure out their direction and speed? also note that at this point i am ignoring friction or anyother outside forces, but that will change in later development

thanks for any help and guidance you could give me

Cruncher,
 
Physics news on Phys.org
  • #2
You need to use the equation for collisions. I don't know whether in your case it is elastic or inelastic. Write an equation for each dimension, one for all momentum in the x direction and one for all the momentum in the y direction.
 
  • #3
it is not elastic, it is as though 2 billiard balls hit each other.. do you know where i could find these equations? thanks

Cruncher
 
  • #4

Related to Calculating Ball Speed and Direction After 2D Collision: Game Programming Tips

1. How is ball speed and direction calculated after a 2D collision?

After a 2D collision, the ball's speed and direction can be calculated using the principles of conservation of momentum and conservation of energy. The formula takes into account the mass and velocity of both objects involved in the collision.

2. What factors influence the calculation of ball speed and direction after a collision?

The main factors that influence the calculation of ball speed and direction after a collision are the mass and velocity of both objects, as well as the angle and point of impact of the collision. Other factors such as friction and air resistance may also play a role.

3. Can the calculation of ball speed and direction be affected by external forces?

Yes, external forces such as air resistance or friction can affect the calculation of ball speed and direction after a collision. These forces may cause the ball to deviate from its expected trajectory or lose some of its initial speed.

4. Is it possible to predict the exact outcome of a collision using these calculations?

While the calculations for ball speed and direction after a 2D collision are based on scientific principles, it is not possible to predict the exact outcome of a collision with 100% accuracy. There are many variables at play and small differences in initial conditions can lead to significantly different results.

5. How can these calculations be applied in game programming?

The calculation of ball speed and direction after a 2D collision is an important aspect of game programming, especially in physics-based games. These calculations can be used to accurately simulate the behavior of objects in a game and create a more realistic and immersive experience for players.

Similar threads

Replies
14
Views
1K
  • Mechanics
Replies
9
Views
1K
Replies
5
Views
2K
Replies
4
Views
2K
  • Introductory Physics Homework Help
Replies
20
Views
1K
  • Classical Physics
Replies
20
Views
897
  • Mechanics
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
1K
Replies
13
Views
2K
  • Introductory Physics Homework Help
Replies
10
Views
1K
Back
Top