Novel Collision Approximation

Game engines use state to handle collisions, constantly updating the positions of particles until a collision is detected. This approach is logical for games because graphics are displayed chronologically, but this isn’t necessarily the best system for education-oriented physics simulations, as to get the state for a time far in the future we’d need to simulate all ticks up until that point. Instead, we can use a little bit of math to create a stateless and functional approach to collision simulation.

To demonstrate, I use algebra to calculate the range of times when two particles can collide on the x axis, and use these bounds to calculate the specifics of potential collisions.

The first step is to isolate t in the following equation, which is the solution for all times two point masses will collide on the x axis given uniform acceleration.

(x1+vx1*t+0.5*ax1*t2)=(x2+vx2*t+0.5*ax2*t2)

After a massive amount of algebra, this gives us:

t=(vx1-vx2)2-4(x1-x2)(0.5ax1-0.5ax2)-vx1+vx2ax1-ax2

To account for radii, we modify the first equation to the following:

(x1+vx1*t+0.5*ax1*t2)-(x2+vx2*t+0.5*ax2*t2)=r1+r2

And now get the following when isolating for t:

t=-vx1+vx2-(vx1-vx2)2-4(0.5ax1-0.5ax2)(-r1-r2+x1-x2)ax1-ax2

Now we know that if the two particles collide, it will be some time (inclusively) between the two t values. This is done with virtually no computational burden. To account for an N-dimensional systems, we repeat the process N times and brute force the solution in the intersection of time intervals.

What are the consequences of this? That is left as an exercise for the reader.

Articles

Made in 2025 by Gil | No rights reserved.