PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Astronomy & The Sky

Other simulators in this category — or see all 45.

View category →
NewUniversity / research

Cosmic Distance Ladder

Log distance scale with parallax, standard candles, and Hubble-flow cartoon rungs.

Launch Simulator
NewUniversity / research

Black Hole Shadow (Schematic)

Silhouette and stylized ring; Rₛ scales with mass — not full GR ray tracing.

Launch Simulator
NewSchool

Sunset Atmospheric Refraction

Geometric vs apparent horizon: lift of the solar disk from a layered atmosphere model.

Launch Simulator
NewSchool

Comet Orbit, Coma & Tails

Eccentric orbit, coma brightening near the Sun, ion and dust tails, solar wind toggle.

Launch Simulator
NewKids

Aurora (Stylized)

Layered sine curtains; hue and drift — look only, not ionosphere physics.

Launch Simulator
NewSchool

Stellar Parallax

Earth orbit angle vs nearby star wobble on fixed background; π = 1/d(pc) arcsec, exaggerated.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Astronomy & The Sky/Spectral Lines & Doppler

Spectral Lines & Doppler

Spectral lines serve as cosmic fingerprints, allowing astronomers to determine the composition, temperature, and motion of distant stars and galaxies. This interactive model visualizes the core principle behind measuring radial velocity: the Doppler shift of absorption lines. When a light source moves relative to an observer, its emitted wavelengths are stretched (redshifted) or compressed (blueshifted). The simulator applies the non-relativistic Doppler formula for light, Δλ/λ₀ ≈ v/c, where Δλ is the change in wavelength, λ₀ is the rest wavelength, v is the radial velocity (positive for recession, negative for approach), and c is the speed of light. Users can manipulate a simplified stellar spectrum, featuring a continuum with several prominent absorption lines, and observe how the entire pattern shifts in wavelength as the radial velocity changes. The model simplifies real astrophysical spectra by using idealized, sharp absorption lines on a smooth continuum, ignoring effects like line broadening from pressure, rotation, or turbulence. It also assumes velocities are small compared to c, making the simple linear approximation valid. By interacting with this tool, students directly explore the relationship between shift magnitude and velocity, learn to identify redshift and blueshift visually, and reinforce the concept that it is the *fractional* shift (Δλ/λ) that matters, not the absolute shift alone. This foundational skill is critical for understanding applications from detecting exoplanets via stellar wobble to measuring the expansion of the universe.

Who it's for: High school and introductory undergraduate astronomy or physics students learning about stellar spectra, the Doppler effect, and the methods of observational astronomy.

Key terms

  • Doppler Effect
  • Redshift
  • Blueshift
  • Radial Velocity
  • Absorption Spectrum
  • Wavelength Shift (Δλ)
  • Rest Wavelength
  • Spectral Line

Radial velocity

120 km/s

For non-relativistic speeds, Δλ/λ ≈ v/c. Stellar and galactic spectra use the same idea as the sound Doppler sim — motion along the line of sight shifts emission or absorption features.

Measured values

Δλ/λ ≈ v/c4.00×10⁻⁴

How it works

A star or galaxy moving away stretches wavelengths toward red; motion toward us compresses them (blue). Astronomers measure tiny shifts in known spectral lines to infer radial velocities and, for cosmology, redshifts.

Frequently asked questions

Why do only some lines in a star's spectrum shift? Don't they all move?
In reality, all spectral lines from a single star shift by the same fractional amount (Δλ/λ). This simulator shows this correctly—the entire pattern moves. A common misconception is that only certain lines shift, which might arise from comparing spectra from different elements or misinterpreting complex, blended spectral features. The constant fractional shift is a key prediction of the Doppler effect for light.
Can we use this Doppler shift method to measure any motion of a star?
No, only the component of motion directly along our line of sight, called the radial velocity. Motion perpendicular to our line of sight (transverse velocity) does not cause a Doppler shift. This is why astronomers often know a star's speed toward or away from us very precisely but must use other, more difficult methods to measure its side-to-side motion.
The formula uses an approximation (≈). When does it break down?
The formula Δλ/λ ≈ v/c is an excellent approximation for velocities much less than the speed of light (v << c). For objects moving at a significant fraction of c, like jets from black holes or distant galaxies in the expanding universe, the full relativistic Doppler formula must be used. This simulator's model is perfect for planetary systems and nearby stars but would be inaccurate for extremely high-velocity scenarios.
How do astronomers know the 'rest' wavelength of a line to measure the shift from?
Rest wavelengths are determined precisely in laboratory experiments on Earth. Each chemical element and ion produces a unique set of spectral lines at specific, known wavelengths. By comparing the observed wavelength from an astronomical source to the laboratory value, the shift (Δλ) is measured directly, allowing the velocity to be calculated.