This composite image shows a region in the halo in the neighboring Andromeda galaxy that astronomers used to precisely measure the galaxy's sideways motion on the sky. This has allowed them to predict a direct collision between Andromeda and the Milky Way about 4 billion years from now.
The inset image on the left is from a 2002 Hubble Space Telescope deep exposure that captured the light from 300,000 stars in Andromeda's halo, a vast spherical cloud of stars surrounding the galaxy's bright disk. Embedded in the image are numerous background galaxies that are much father away than Andromeda.
Astronomers compared this region to pictures of the same area taken seven years later. They measured the tiny amount of sideways drift in the halo stars relative to the stationary background galaxy field. The same measurements were done for two other fields in the galaxy as well. This is similar to measuring the drift of a boat relative to a background shoreline.