Redshift and Blueshift Simulator: Doppler, Gravitational and Cosmological
Free redshift and blueshift simulator: watch light shift near and far from a heavy mass (gravitational redshift, clocks and refractive-index view), moving sources with relativistic Doppler wavefronts, a spectrum shifter that combines motion, gravity and cosmic expansion, and an expanding-universe calculator with lookback time and distance.
Light that falls toward a heavy mass arrives blueshifted; light that climbs away from it arrives redshifted. In the picture below the mass is on the left: clocks run slower there, so a wave of fixed frequency has a shorter wavelength, as if the space were a medium with a higher refractive index n = 1 / (clock rate). Press Emit pulse.
Check it against real experiments
A moving source emits waves that bunch up ahead of it (blueshift) and spread out behind it (redshift). Each ring below is a light wavefront, coloured by the shift an observer in that direction would see. At high speed time dilation matters too: a source slows its own emission by γ, so even sideways light is redshifted.
Shift a real set of spectral lines by any mix of causes. The three sources of redshift multiply: (1+z) = (1+zmotion) × (1+zgravity) × (1+zexpansion). Lines that leave the coloured band turn into ultraviolet, infrared or radio waves.
Work out z from one line
Cosmological redshift is not a Doppler shift through space: the space light travels through stretches, so every wavelength is stretched by the same factor as the universe grows, 1 + z = anow / athen. Distances here use a flat ΛCDM universe (radiation neglected).
The gravitational potential Φ of a ball of mass M: inside a uniform ball it is Φ = −GM(3R² − r²)/(2R³), outside Φ = −GM/r. Its slope is the pull of gravity, √(−2Φ) is the escape speed, and in the weak-field optical analogy light moves as if space were glass with refractive index n = 1 − 2Φ/c²: slower and bent toward the mass.
Slice through the centre (±4 R). Move the pointer for readouts; drag up and down to move the light ray.
Φ as a height: the "funnel". Drag to turn it; the flat bottom inside the ball is a parabola, not a spike.
What this analogy is, and is not
- n = 1 − 2Φ/c² is the weak-field optical analogue of general relativity (isotropic coordinates). Outside the ball it gives the full Einstein deflection 4GM/(c²b) — twice what a Newtonian particle of light would get — and the Shapiro time delay. The numerical ray on the map is traced through this index and checked against 4GM/(c²b) in the page's tests.
- It is only accurate while |Φ|/c² ≪ 1. For a neutron star it is rough; for the Sun squeezed to 2 km it fails completely (that object would be inside its own Schwarzschild radius, a black hole). The Black Hole Simulator uses the exact strong-field index.
- The ball has uniform density. Real planets and stars are denser at the centre, which makes their centre deeper than 1.5× the surface value.
- The index describes light as seen by a far-away observer. Locally, every observer still measures light passing at c. Compare the “Near / far from a mass” tab, which uses the related index 1/(clock rate), and the Light & Metamaterials Lab for real refraction.
Redshift and blueshift explained
A redshift lengthens the wavelength of light, a blueshift shortens it. Astronomers measure it as z = (λobserved − λemitted) / λemitted; a positive z is red, a negative z is blue. There are three physical causes, and this page simulates all of them:
- Motion (Doppler shift). A source moving away is redshifted, one moving toward you is blueshifted: 1 + z = √((1 + β) / (1 − β)) along the line of sight, and the general formula fobs = fsrc / (γ(1 − β cos θ)). Even sideways motion gives a redshift 1 / γ because the moving source's clock runs slow.
- Gravity. Near a mass clocks run slow, by √(1 − rs/r) with rs = 2GM/c². Light climbing out of a gravity well is redshifted, light falling in is blueshifted: fobs/fsrc = √((1 − rs/rsrc) / (1 − rs/robs)). The 1959 Pound-Rebka experiment measured it across 22.5 metres; GPS satellites must correct for it every day.
- Expansion of space. Light from distant galaxies is stretched as the universe grows: 1 + z = anow/athen. At z = 1089 the light is the cosmic microwave background.
The refractive-index picture
Because clocks tick slower near a mass, a wave whose frequency is fixed in far-away time has a shorter wavelength nearby, just as light entering glass keeps its frequency and shortens its wavelength. Treating gravity as a medium with index n = 1 / (clock rate) reproduces the redshift, the slowing of light near a mass (the Shapiro delay) and light bending. It is an analogy for the Schwarzschild geometry, not a separate theory, and the animation exaggerates the tiny real numbers so you can see them (switch to True scale for the real picture).
Gravity as refraction
The Gravity as refraction tab draws the gravitational potential of a uniform ball (−GM(3R² − r²)/(2R³) inside, −GM/r outside) as a colour map with contours and field lines, as a 3D funnel, and along a line through the centre together with the pull of gravity, the escape speed and the weak-field optical index n = 1 − 2Φ/c². A light ray traced through that index bends by 4GM/(c²b), the general-relativity value (1.75 arcseconds for a ray grazing the Sun).
Questions
- Is a cosmological redshift a Doppler shift?
- Not exactly. Galaxies are nearly at rest in their own patch of space; the space between them grows. For small z the two agree (z ≈ v/c); for large z they differ, and the recession speed in the table can even pass the speed of light, which is allowed because nothing moves through space that fast.
- Why does gravitational redshift matter for GPS?
- Satellite clocks run about 45.7 µs a day fast from gravity and 7.2 µs slow from their speed, a net 38.5 µs a day. Uncorrected, positions would drift by about 10 km a day.
- Why can nothing be seen leaving a black hole?
- As the emitter approaches the horizon (r = rs) the redshift grows without limit, so the light is stretched to nothing and arrives later and later.
Limits: static emitters and receivers in the Schwarzschild geometry (no spin, no orbital Doppler mixed in), a flat ΛCDM universe without radiation (the age at very high z is approximate), the spectral lines are laboratory values to 0.1 nm. For research use real ephemerides and models.
