# Collision Detection in 2D Motion

## Main Question or Discussion Point

I have created a very simple numerical simulation that models an object being thrown off a building at some angle, and when the object hits the ground, the simulation stops. Now I want to add in collision detection. How would I go about doing this? What would be the equations needed to compute the new values of time, velocity and position?

Related Classical Physics News on Phys.org
Khashishi
What's the shape of the object and the ground? Is the object spinning? Are you interested in just the moment of impact, or you want to know what happens afterward?

If you want to know what happens afterward, you need to make some assumptions about the elasticity, how it deforms, and how much rotational energy is transferred to the ground.

It is a ball that has elasticity. I expect the ball to bounce upon impact with the ground. The ground is a flat surface that is stationary

Khashishi
It depends on how thorough you want to be. The easiest thing to do is just simulate with a constant step size, and do something like
a_y(t+dt) = a_y(t) - g*dt
v_y(t+dt) = v_y(t) + a_y(t)
y(t+dt) = y(t) + v(t)
if y(t) < 0, then {
y(t+dt) = 0
v_y(t+dt) = -elasticity*v_y(t)
v_x(t+dt) = damping*v_x(t)
}

Of course, you didn't say how detailed your simulation is.

No, there's something even easier. If the collision is perfectly elastic (which is very close to true for bouncy balls), and the thing it is hitting is very massive (like the ground or a wall), then you just flip the direction of the velocity vector component that is normal to the surface of collision.