Galaxy Merger
Elapsed
--
Core separation
--
Star particles
--
Phase
--
How it works

Two massive cores attract each other and every star particle with softened Newtonian gravity. Each disk of stars starts with a tangential velocity so it orbits its own core like a spiral galaxy — until the second core's pull rips the arms into long tidal tails as the cores swing past or merge.

F = G * m1 * m2 / (r^2 + eps)
v_tangent(r) = sqrt(M_core / (r + 2)) * 0.42
  • Time speed — scales the simulated time per real second.
  • Gravity strength — scales the gravitational constant used by both the core-core pull and the core-star pull.
  • Star density — how many star particles make up the two disks (reseeds on change).
  • Trails — leaves faint streaks behind each star instead of clearing the frame, making the spiral and tidal motion easier to read.

The simulation reseeds itself automatically once the cores have had enough time to fully interact, so you can watch fresh encounters back to back.