The two galactic cores are gravitating point masses. Their relative separation vector r is integrated from Newton's law with a softened potential (so it never diverges at close approach):
a = -G(m1+m2)·r / (|r|² + ε²)^1.5
Each core's own screen position is then the reduced-mass split of that relative vector around a fixed centre of mass — exactly the standard two-body reduction. Roughly 900 massless "star" particles per galaxy start on circular Keplerian orbits around their own core, then respond every step to the combined gravity of both cores (a restricted three-body approximation, the same technique Toomre & Toomre used in 1972 to first reproduce tidal tails numerically). No self-gravity between stars is computed — that is what keeps 1,800 particles running at 60 FPS on a phone.
- Mass ratio — how much heavier the second core is; a lopsided merger raises one galaxy's disk almost intact while shredding the other's.
- Approach velocity & impact parameter — together they set the orbital energy. A high approach speed or large offset gives a hyperbolic (unbound) flyby that never returns; a slow, close pass stays bound and the cores keep re-encountering until they merge.
- Orbit type readout is the sign of the specific orbital energy ½v² − G(m1+m2)/r, computed live from the actual integrated state, not guessed from the sliders.