Real-time simulation of a spiral galaxy using GPU-accelerated gravity. Watch stellar orbits stabilise into spiral arms over millions of simulated years, revealing the gravitational choreography that shapes galactic structure.
Stars are attracted via Newton's inverse-square gravity, approximated with a Barnes-Hut tree. Differential rotation at different orbital radii naturally creates trailing spiral arms — an emergent pattern.
Drag to rotate, scroll to zoom. Use sliders to adjust star count, gravitational softening, and rotation speed. Add a second galaxy and watch them collide and merge over simulated aeons.
Real galaxy rotation curves do not match Newtonian predictions for visible matter alone — they stay flat far from the centre. This discrepancy is key evidence for Dark Matter making up ~27% of the universe.