This simulation illustrates the gravity assists of spacecraft passing close to the Moon, as detailed in the Wikipedia article at:
There are 100 spacecraft shown, which have just been launched vertically upwards from different places on the Earth's surface. The spacecraft are travelling in the plane of the Moon's orbit.
You can run the simulation to see how the spacecraft's trajectories are affected by the presence of the Moon. Most of the spacecraft eventually return to the Earth, but a few escape from the Earth and pursue their own independent orbits around the Sun. Since different computers run at different speeds, you may need to edit the evolution time step to get the simulation to run at an acceptable rate.
You can also try deleting the Moon before running the simulation to see how the gravitational influence of the Sun prevents the spacecraft from all returning to the Earth at the same time.
Copyright © 2005-2023, AstroGrav Astronomy Software