4

So I have two particles that have collided in 3 dimensional space. I want the particles to rebound off of each other in an elastic manner. How do I determine the resultant velocity vector if I know: Both particles' initial velocity vector, their masses, and their initial position vectors relative to the origin.

I tried to follow the instructions on this website but I am not sure how to make their equations work without polar coordinates / how to translate my data to polar coordinates.

Also, if you answer my question in terms of polar coordinates, can you explain which angle is theta and which is phi? Since there are 2 different conventions, I am not really sure which angle is being referred to in the explanation on the aforementioned website.

EDIT: This isn't for a class. I'm writing a physics engine for a gravity simulation I am making using Unity. I haven't taken kinematics since I was in high school, which is why I am so rusty.

Qmechanic
  • 201,751
Mitch
  • 51

3 Answers3

6

I'm shocked that there isn't a satisfactory answer on this site yet!

This can be answered in any number of dimensions with some relatively simple vector math. As follows intuitively (rigorously in the center-of-mass frame), for equal mass particles, the relative velocities of the particles are reversed along the normal direction. All that needs to be done is translate that into vector equations.

The algorithm

Calculate the vector normal of collision: $$\hat{\bf n}=\frac{{\bf r}_1-{\bf r}_2}{\|{\bf r}_1-{\bf r}_2\|}$$ Calculate the relative velocity of the particles in the direction of the normal, using a dot product: $$v_{\mathrm{rel}}=(\dot{\bf r}_1-\dot{\bf r}_2)\cdot \hat{\bf n}$$

To reverse the velocities of the particles along the normal of collision, take:

$$\dot{\bf r}_1\mapsto \dot{\bf r}_1- v_{\mathrm{rel}}\hat{\bf n}$$ $$\dot{\bf r}_2\mapsto \dot{\bf r}_2+ v_{\mathrm{rel}}\hat{\bf n}$$

That's it. Easy peasy. It works in 1D, 2D, 3D, 4D, 5D; any number of dimensions. And it's rather simple!

Seeing that the algorithm works

To see that this reverses the velocities along the normal direction, calculate $\dot{\bf r}_1\cdot \hat{\bf n}$ before and after. You'll find: \begin{align*} v_{\mathrm{rel}}= (\dot{\bf r}_1-\dot{\bf r}_2)\cdot \hat{\bf n} &\mapsto \dot{\bf r}_1\cdot \hat{\bf n}- v_{\mathrm{rel}}\hat{\bf n}\cdot \hat{\bf n}-\dot{\bf r}_2\cdot \hat{\bf n}- v_{\mathrm{rel}}\hat{\bf n}\cdot \hat{\bf n}\\ &=v_{\mathrm{rel}}-2v_{\mathrm{rel}}\\ &=-v_{\mathrm{rel}} \end{align*}

1

One key point is that the velocity and momentum of the center of mass of the system do not change as a result of the collision. I would recommend calculating the velocity of the center of mass prior to the collision, and then use the fact that it is unchanged to compute the new velocities. If the collision is truly elastic (no dissipation), then the kinetic energy of the system will also be conserved. Momentum and Kinetic Energy Conservation should be all you need to compute the post-collision velocities.

Bryson S.
  • 3,876
0

If you are writing your physics engine in cartesian coordinates, it's probably much easier to perform the collision calculations in cartesian coordinates instead of trying to use the equations from that website. Also, you speak of two particles colliding, which sounds to me as if you are treating them as point masses, while that site is performing calculations for two spheres colliding.

If you want to simulate elastic collisions between point masses in 3 dimensions in cartesian coordinates, it's probably easiest to just work out the equations yourself! That way you'll also have much less trouble debugging your code (this is from my personal experience).

xuanji
  • 1,082