Particles

This simple particle simulation is designed to foster an appreciation for the intrinsic beauty of gravitational forces. Enriched with a visually captivating touch, there is a red particle that responds to the movements of the mouse.
Larger particles correspond to larger masses on a scale from 1 to 5, and the red particle has a mass of 200.
Additionally, when particles bounce off the walls, their speed decreases.

The Potential for Infinite Values

In physics, when dealing with forces acting at a distance, one must be mindful of the potential for infinite values. The formula for gravitational force involves the division by the square of the distance between particles. As the distance approaches zero, the force magnitude tends towards infinity. While this scenario might not be practically achievable in the real world due to physical constraints (here the fun), in simulations, it’s essential to handle such situations gracefully.

In the code, a check is implemented to ensure that the force magnitude does not become too extreme. If the distance between particles falls below a certain threshold (in this case, 10 units), the force is set to zero. This prevents the simulation from producing unrealistic and potentially destabilizing results when particles are extremely close to each other.

It’s super fun because the limitation of describing nature through Newton’s gravitational model at extremely small distances is a clear indication of the need for more advanced physical models, such as Einstein’s General Theory of Relativity and quantum mechanics, to fully comprehend the behavior of gravity and fundamental forces.