Q&A: Milky Way Galaxy
The Andromeda Galaxy (otherwise known as M31) is about 2.2 million light years away from us. To measure this distance, a special class of variable stars called cepheid variables was used. These variables are known as "standard candles" because their intrinsic brightness can be accurately measured. If astronomers know the intrinsic brightness of a star, they can estimate how bright it would be at any given distance. Astronomers then used the apparent brightness of the cepheids in Andromeda to work out how far away this galaxy is.