# When two objects collide, which directions do they go in after the collision?

I am watching this video here:

At 11:02, the author shows a simulation and says that for a Galton Board (https://en.wikipedia.org/wiki/Galton_board), the position and speed of a particle at any given time can be described by the following equations:

$$x(t + \Delta t) = x(t) + v(t)\Delta t$$

$$v(t + \Delta t) = v(t) + g\Delta t$$

I am confused as to how these equations can fully describe the movements within the simulation, since there is movement in both the $$x$$ and $$y$$ directions. I understand this video is not meant to provide a detailed analysis of this, but I wanted to try and derive the equations for the movements of particles on a Galton Board. Specifically, I consider a simplified case of a single free falling particle (i.e. blue ball) and a single "peg" (i.e. red ball). I am not taking into consideration the mass of the balls or quantities like friction and air resistance.

To begin, I think there should be 2 equations for movement and 2 equations for velocity:

$$x(t + \Delta t) = x(t) + v_x(t)\Delta t$$ $$v_x(t + \Delta t) = v_x(t) + g_x\Delta t$$

$$y(t + \Delta t) = y(t) + v_y(t)\Delta t$$ $$v_y(t + \Delta t) = v_y(t) - g\Delta t$$

The author then describes how these equations change their form when a coefficient of restitution is added to describe the collisions.

I think the following modification can then be made - provided the particle bounces backwards in the exact opposite direction relative to its path before the collision (gravity only affects velocity in the $$y$$ direction):

$$v_x(t + \Delta t) = -\alpha \cdot v_x(t)$$ $$v_y(t + \Delta t) = -\alpha \cdot v_y(t) - g\Delta t$$

And these changes in velocities immediately after the collision should affect the position of the particle after the collision:

$$x(t + \Delta t) = x(t) + (-\alpha \cdot v_x(t))\Delta t$$ $$y(t + \Delta t) = y(t) + (-\alpha \cdot v_y(t))\Delta t - \frac{1}{2}g(\Delta t)^2$$

But I am not sure how these equations affect the direction of the particle after the collision. I think another equation is needed to describe the angle of the particle (relative to either the horizontal or vertical axis) at any given time. Using trigonometry, this angle is the ratio of the vertical velocity and horizontal velocity:

$$\theta = \arctan\left(\frac{v_y}{v_x}\right)$$

And finally, another equation for $$\theta$$ needs to be written to describe the angle of the particle immediately after collision. Using the previous equations involving the coefficient of restitution, I think the earlier $$\theta$$ equation can be modified to represent the angle immediately after the collision:

$$\theta' = \arctan\left(\frac{-\alpha \cdot v_y(t)}{-\alpha \cdot v_x(t)}\right)$$

Thus, in summary, we can write the following equations for this scenario:

$$\text{Horizontal Position:} \quad x(t + \Delta t) = x(t) + v_x(t)\Delta t$$ $$\text{Horizontal Velocity:} \quad v_x(t + \Delta t) = v_x(t)$$

$$\text{Vertical Position:} \quad y(t + \Delta t) = y(t) + v_y(t)\Delta t - \frac{1}{2}g(\Delta t)^2$$ $$\text{Vertical Velocity:} \quad v_y(t + \Delta t) = v_y(t) - g\Delta t$$ $$\text{Horizontal Velocity after collision:} \quad v_x'(t + \Delta t) = -\alpha \cdot v_x(t)$$ $$\text{Vertical Velocity after collision:} \quad v_y'(t + \Delta t) = -\alpha \cdot v_y(t) - g\Delta t$$ $$\text{Horizontal Position after collision:} \quad x'(t + \Delta t) = x(t) + (-\alpha \cdot v_x(t))\Delta t$$ $$\text{Vertical Position after collision:} \quad y'(t + \Delta t) = y(t) + (-\alpha \cdot v_y(t))\Delta t - \frac{1}{2}g(\Delta t)^2$$

$$\text{Angle before collision:} \quad \theta = \arctan\left(\frac{v_y(t)}{v_x(t)}\right)$$ $$\text{Angle after collision:} \quad \theta' = \arctan\left(\frac{-\alpha \cdot v_y(t)}{-\alpha \cdot v_x(t)}\right)$$

Can someone please help me understand if these equations are correct?

• The fact that the letters are bold seems to indicate they are vectors so all equation are accounted for. Commented Jun 16 at 18:40
• I disagree with the one who wants to close this question, and marked as a homework-like question. The OP is asking for help in the governing equations of a system he met in a online course. He's asking for help, not in the solution of a task/homework he have to do Commented Jun 16 at 20:41
• @basics Agreed. I am voting to reopen and have upvoted your answer. Commented Jun 17 at 6:06

If you're interested in basics of simulations of multibody dynamics, I'd suggest to you the video seris of the Yt channel "Ten Minute Physics", https://www.youtube.com/@TenMinutePhysics, where a Nvidia engineer explains some of the basic methods, with the mathematical details you're asking for.

Now, let's split the answer to address here some of your questions.

Vector equations.

To begin, I think there should be 2 equations for movement and 2 equations for velocity:

Bold letters mean vector there, \begin{aligned} \mathbf{x}(t + \Delta t) & = \boldsymbol{x}(t) + \mathbf{v}(t)\Delta t \\ \mathbf{v}(t + \Delta t) & = \mathbf{v}(t) + \mathbf{g}\Delta t \ ,\end{aligned}

and every vector can be written in Cartesian coordinates as $$\mathbf{a}(t) = a_x(t) \mathbf{\hat{x}} + a_y(t) \mathbf{\hat{y}}$$.

Collisions.

I think the following modification can then be made - provided the particle bounces backwards in the exact opposite direction relative to its path before the collision (gravity only affects velocity in the y direction):

Nah! Considering for a while perfectly elastic collisions of a ball with a wall, the tangential component after the collision is the same, while the normal component is the opposite, namely:

\begin{aligned} \mathbf{v}_{before} & = v_n \mathbf{\hat{n}} + \mathbf{v}_t \\ \mathbf{v}_{after} & = -v_n \mathbf{\hat{n}} + \mathbf{v}_t \ , \\ \end{aligned}

with the tangential component that can be evaluated as the difference of the velocity and its normal component $$\mathbf{v}_t = \mathbf{v} - v_n \mathbf{\hat{n}}$$, where $$v_n = \mathbf{v} \cdot \mathbf{\hat{n}}$$. With some algebra, it's should be clear that $$\mathbf{v}_{after} = \mathbf{v}_{before} - 2 v_n \mathbf{\hat{n}} \ .$$

For inelastic collisions I'd refer to the video series suggested at the beginning of this answer.

Position correction. You're right that position correction is required to avoid body penetration. I'd suggest to take a look at the Ten Minute Physics for the treatment of position correction as well.

General suggestion. Use vector algebra as much as you can without relying on trigoniometric functions.

• Go anonymous downvoter, go! I can't understand why someone keeps downvoting without comments. Even the question... Commented Jun 16 at 20:38
• @ basics: I appreciate your answer!
– bula
Commented Jun 16 at 20:42
• good to hear that. If it's useful, please upvote, since it's the way we do on this site. If you think this answer has solved your problems, you can also accept the answer, since - again - it's the way we do on this site (and many people forget) Commented Jun 16 at 20:45
• unfortunately I can not upvote because I need a minimum of 15 points to upvote. If you upvote my question, I will have 10 points I think ... and then 5 more and I will be able to upvote yours
– bula
Commented Jun 17 at 2:09
• Its unfortunate that you were downvoted and my question was closed
– bula
Commented Jun 17 at 2:09