Collision basins for three equal masses on an equilateral triangle.

Featured project

Mapping Chaotic Gravitational Basins

Visualising what the gravitational basins for n fixed masses may look like. Clicking this button will frac…tal your mind. Yeah, that sounded better in my head.

An open-source physics simulation by Nirav Ramdhanie.

All the planets are held fixed in space. An asteroid is released from rest at every starting point, is influenced by the gravity of the planets until it collides with one or runs out of the allotted maximum time. We then colour the start by which planet it hit (or by how long it took to collide) and in the end is a map of collision basins. The boundary is chaotic and looks to be Wada-like if you zoom in.

Now make like the asteroids and click that enticing button.

Interactive visualiser

Explore the 4-D basins for the Restricted 4 Body System. 6.25 million asteroids were simulated.

Gallery

Renders and screenshots.

3D render of the collision basins — a lattice cube of starting points, each coloured by the planet its asteroid hits.
The basins in 4-D — a 3-flat through the lattice of initial conditions.
2D slice of the collision basins for three equal masses on an equilateral triangle — each region coloured by which planet an asteroid launched from that point reaches; white rings mark the planets.
A 2-D slice — three equal masses on an equilateral triangle.
The same basins coloured by time-to-hit — a warm red core wrapped in slower yellow-green filaments.
The same system, coloured by time-to-hit.

Built with

Python 3.10+CuPy · CUDA GPUManim · 2DVisPy · 3DNumPyPillow

Runs on an NVIDIA GPU (CuPy / CUDA); macOS is not supported.

Source on GitHub

MIT-licensed · © 2026 Nirav Ramdhanie