For the nearest stars, the change in the position of the Earth in its orbit results in a tiny shift in the position of the nearby star relative to the distant background stars. This shift is called the trigonometric parallax. You can see the effect by holding your thumb up at arms length, closing your left eye, and lining up your thumb with something across the room. Now, alternate back and forth between having your right eye open and your left eye open and you’ll see the position of your thumb shift relative to an object further away. Move your thumb closer, and the shift is larger. That is the essence of trigonometric parallax.
The distance to the star in parsecs (1 pc = 3.26 ly) is just
Now, a star’s distance, apparent brightness, and “true” (or intrinsic) brightness are related in the following way:
M = m + 5 (1 – log d)
where M = the absolute magnitude of the star
and m = the apparent magnitude of the star
and d = the distance to the star in parsecs
The absolute magnitude is the apparent magnitude the star would have if it were at a distance of 10 parsecs. Looking at it another way, the absolute magnitude is a proxy for the intrinsic brightness. The apparent magnitude is the star’s apparent brightness (as seen from Earth).
While the above equation is highly useful for general purpose calculations, to get the most accurate values astronomers must take into account atmospheric and interstellar extinction. And, anytime we deal with a star’s luminosity and its apparent brightness at some distance, d , we must specify the photometric system and optical filter that is being used. Or, less commonly (for practical reasons), we specify that the star’s luminosity and apparent brightness is to include all wavelengths of the electromagnetic spectrum, thus bolometric magnitudes are to be used.
Spectroscopic parallax is a bit of a misnomer, but here’s how it works for approximating the distance to main-sequence stars that are too far away to exhibit a measurable, reasonably certain, trigonometric parallax: measure the apparent magnitude of the star, and then using its spectrum to find its position on the H-R diagram, read off its absolute magnitude. Using your measured apparent magnitude and the star’s estimated absolute magnitude, you can solve for d the distance in the above equation.
Hertzsprung–Russell (H-R) diagram
The star’s color (the x-axis on the H-R diagram) is easy to measure, but a deeper analysis of the spectral lines is needed to determine whether the star is a main-sequence, giant, or supergiant star (or something else).