In 2006, astronomers announced a planet about five times the mass of Earth, orbiting a faint star 21,500 light-years away. Nobody has seen the planet, and nobody had seen its star. For about a day in August 2005, the planet's gravity bent the light of a different, more distant star, and that was enough. This simulator calculates how, live in your browser, using the parameters published for that event and several others. It follows our black hole, pulsar and light-speed simulations, and like them it is calculated, not drawn.

A dark sky enlarged millions of times, with a dashed gold circle, a marked lens star, a small image of the background star on one side and a larger image beside a marked planet on the other. Below, a light curve with a short bump about ten days after its peak.
OGLE-2005-BLG-390, ten days after the peak, enlarged millions of times. The lens star's gravity has split the light of a more distant star into two images; one of them is passing over the planet. The light curve below shows the planet's bump of 16%.

What you’re looking at

The surprise: two lenses or one?

While working on this, I was surprised to learn how a planet's signal really works. The natural picture, and one you'll find in many diagrams, is two separate lenses: the star passes in front of the background star and brightens it, and the planet does the same later, adding a little bump of its own. For that, the planet would have to pass almost exactly in front of the background star.

For most planets found this way, that isn't what happens. The planet doesn't need to pass in front of the background star; it needs to sit on one of the star's images. The host star has already stretched the background star's light into arcs near the Einstein ring, and a planet near those arcs disturbs them. In OGLE-2005-BLG-390, the two-separate-lenses picture predicts no planet signal at all: the background star never passed near the planet itself. The real calculation gives the bump that was seen.

The light curve of OGLE-2005-BLG-390 with the planet's bump (gold), and the two-separate-lenses picture (teal dotted) with no bump.
Gold: the full calculation. Teal dotted: the common picture of two separate lenses, which misses this planet entirely.

A planet can even take light away. A planet inside the Einstein ring sits near the fainter image and can shrink it, so the star looks dimmer than it would without the planet. In OGLE-2016-BLG-1067, a planet about half Jupiter's mass cut the brightness by up to 21% for two to three days.

More things the calculation shows

“No great chance”

In 1936 a Czech engineer and amateur scientist, Rudi Mandl, persuaded Einstein to publish a short calculation of one star acting as a lens for another. Einstein concluded that "there is no great chance of observing this phenomenon", and privately called the paper "of little value". Fifty years later Bohdan Paczyński pointed out that if you watch millions of stars, about one in a million is being lensed at any moment. In 1991 Paczyński and Shude Mao showed the method could find planets, and in 1992 Andrew Gould and Avi Loeb showed that a system like ours would show up in about one event in five. The first events were seen in 1993 and the first planet in 2003. About 290 planets have now been found this way, and NASA's Roman Space Telescope, launched on 30 August 2026, is expected to find more than a thousand more.

How astronomers measure it

The shape of the light curve gives the geometry: how close the background star passed, the planet's mass as a fraction of its star's, and its distance from the star in Einstein radii. The mass and distance of the lens itself need more: the event seen from two places, or a sharp image of the lens star years later. Hubble did that for the first planet less than two years after the event. Many published masses are still estimates, and the page says which.

Animation vs. simulation

An animation is drawn to look right. Here nothing is drawn: for every pixel, the graphics card follows the light back through the lens equation of general relativity to the background star, and the light curve adds up the images exactly. The planet's bump comes out of the equations, at the time the astronomers reported it, because each real event uses their published parameters.

Comparing against known results

A separate Python program, written independently, works the same problems a different way: the images at 40-digit precision, and the brightening of a finite star by brute-force ray tracing. The simulator agrees with it to about one part in ten thousand or better, and it reproduces the published times of the planets' signals: the bump in OGLE-2005-BLG-390 about ten days after the peak, and the caustic crossings of OGLE-2003-BLG-235 about 13 and 6 days before it.

Where to view it

It runs on your device's graphics card and works best on a laptop or desktop. It opens on OGLE-2005-BLG-390. Then try “Two lenses or one?”, “Bigger, not brighter” and the map behind the lens, and the other real events: the first planet found this way, the planet that takes light away, the star passing right behind another, the rogue planet, and our own Sun with Jupiter or Earth.

Built with Claude Opus 5.5

I built this with Claude Opus 5.5: the physics design, the GPU code, the test programs that check it, and the write-up. Every image comes from the simulator itself, and the method section gives the equations, the tests and the papers behind each event.

I’m sure I’ve gotten some details wrong, so corrections are welcome. The images are free to use, for teaching or anything else, with credit. Try it here.