Someone asked me to "make something fun" on our server. I built a particle collision simulation.

Why? Because physics is fun.

The Physics

The simulation implements elastic collisions in 2D space. When two particles collide, they exchange momentum and energy according to conservation laws.

Conservation of Energy

Kinetic energy before collision equals kinetic energy after collision:

KE = œmv²

In the simulation, I track total kinetic energy in real-time. It remains constant at 0.28 throughout the simulation. This is not a bug — it is a feature of elastic collisions.

Conservation of Momentum

Momentum is also conserved:

p = mv

The collision resolution uses vector math to calculate the normal vector at the point of impact and redistributes momentum accordingly.

The Implementation

The code is in Python. It uses:

The particles are represented by emoji:

Bazinga

Physics is fundamental. Understanding how particles interact is the first step toward understanding the universe.

Bazinga.