Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 37 ยท Galaxies and the Universe

Measuring Cosmic Distances

Learn how astronomers measure distances with parallax, the distance modulus, Cepheid variables and Type Ia supernovae, and calculate them in Python.

How far away is a star? You cannot lay down a tape measure. Astronomers solve this with a chain of methods, each one calibrated by the one before. It is called the cosmic distance ladder. In this lesson you will climb its main rungs, and use the formulas yourself.

Rung 1: parallax

Hold a finger at arm's length and look at it with one eye, then the other. It seems to jump against the background. This shift is parallax. Astronomers do the same with a star, using Earth's orbit as the baseline: they measure the star's position six months apart, from opposite sides of the orbit, and find a small angle p.

The parsec (pc) is defined by this method: a star with a parallax of 1 arcsecond (1/3600 of a degree) is 1 parsec away. So:

d (in parsecs) = 1 / p (in arcseconds)

One parsec is about 3.26 light-years, or 3.086 ร— 10ยนโถ m.

Python Distance from parallax

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Parallax angles are tiny. Ground telescopes cannot measure them well beyond a few hundred light-years. The European Space Agency's Gaia satellite measures positions with such accuracy that it provides parallaxes for over a billion stars, reaching thousands of parsecs.

Standard candles and the distance modulus

When parallax runs out we use standard candles: objects whose true brightness (absolute magnitude, M) we know. Comparing it to the brightness we observe (apparent magnitude, m) tells us the distance.

Astronomers measure brightness on the magnitude scale, where a smaller number means brighter, and a difference of 5 magnitudes is a brightness factor of exactly 100. Absolute magnitude is defined as the apparent magnitude an object would have at 10 parsecs. The two are linked by the distance modulus:

m โˆ’ M = 5 logโ‚โ‚€(d / 10 pc)

so

d = 10 pc ร— 10^((m โˆ’ M) / 5)

(This ignores dust dimming, which astronomers must correct for in real work.)

Python Distance modulus calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first check is a good sanity test: using the Sun's known magnitudes, the formula returns about 1 AU.

Rung 2: Cepheid variables

In 1912, Henrietta Leavitt studied variable stars in the Small Magellanic Cloud and found that the brighter ones pulsate more slowly. Cepheid variables brighten and dim regularly, with periods from about a day to over 100 days, and their period is linked to their true luminosity. Measure the period, read off the luminosity, compare it with the apparent brightness, and you have the distance.

An approximate calibration in visual light is

M_V โ‰ˆ โˆ’2.43 (logโ‚โ‚€(P / days) โˆ’ 1) โˆ’ 4.05

Because Cepheids are very luminous, they can be seen in other galaxies. In the 1920s Hubble used them to prove that Andromeda lies far outside the Milky Way, and Hubble Space Telescope observations of Cepheids still anchor today's distances to galaxies tens of millions of light-years away.

Python Distance to a Cepheid

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The numbers are an illustration of the method, using a made-up star at magnitude 16.

Rung 3: Type Ia supernovae

Cepheids are limited to nearby galaxies. Type Ia supernovae (see massive stars and supernovae) reach an absolute magnitude of about โˆ’19.3 at peak (brighter than a whole galaxy for weeks), so they work as standard candles across billions of light-years. The pattern is the same: measure m at peak, use M โ‰ˆ โˆ’19.3, and compute d.

Redshift for the furthest galaxies

For the most distant galaxies, astronomers measure the redshift: how far spectral lines have moved to longer wavelengths. In an expanding universe, redshift grows with distance. This is the topic of the expanding universe. Each method is checked against the one below it, so errors in the lowest rungs affect all the others; this is why re-measuring the nearby calibration matters so much.

flowchart TD
A["Parallax<br/>to a few thousand pc"] --> B["Cepheid variables<br/>to tens of Mpc"]
B --> C["Type Ia supernovae<br/>to billions of light-years"]
C --> D["Redshift and Hubble's law<br/>to the edge of the observable universe"]

Each rung of the distance ladder calibrates the next.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A star has a parallax of 0.05 arcseconds. How far away is it?

    d = 1 / p = 1 / 0.05 = 20 parsecs.
  2. 2. What makes Cepheid variables useful?

    Leavitt found that longer period means higher luminosity, so Cepheids are standard candles.
  3. 3. On the magnitude scale, a difference of 5 magnitudes corresponds to a brightness ratio of

    The scale is logarithmic and defined so that 5 magnitudes means exactly a factor of 100.
  4. 4. An object has m = 15 and M = 0. Its distance modulus is

    The distance modulus is m โˆ’ M = 15 โˆ’ 0 = 15, which corresponds to 10 ร— 10ยณ pc = 10,000 pc.

Summary

  • Parallax gives direct distances: d(pc) = 1 / p(arcsec).
  • Standard candles use m โˆ’ M = 5 logโ‚โ‚€(d / 10 pc).
  • Cepheids (period-luminosity relation) and Type Ia supernovae extend the ladder to huge distances.
  • Each rung calibrates the next, so errors can propagate upward.

Next: How Telescopes Work