Distances in space are hard.

Unless you know precisely how intrinsically bright something is, working out how far away it is is extremely difficult. And there's a lot of stuff out there in the cosmos for which intrinsic brightness is not well defined.

This means that we can get distances very wrong sometimes. Case in point: new simulations show that a gigantic structure encircling the Milky Way may be a lot closer than we thought.

That structure is the Magellanic Stream, a huge, high-velocity stream of gas wrapped most of the way around our galaxy.

This long tendril of material originates in the Large and Small Magellanic Clouds, satellite dwarf galaxies that orbit each other, and which will probably eventually be cannibalized by the Milky Way.

The Clouds' gravitational interactions have ripped out a large amount of gas that now arcs across Earth's sky.

There are a lot of things in the sky that are more visible than the Magellanic Stream, so figuring out how it formed has been an ongoing problem. It wasn't until last year that a team of scientists found that the gas was likely stripped from the galactic haloes of the Magellanic clouds, giant clouds of gas and plasma that envelop most galaxies.

Now, the same team has used astronomical models to model the formation and evolution of the Magellanic Stream over 3.5 billion years – and found that it could be five times closer to us than we realized.

"The Magellanic Stream origin has been a big mystery for the last 50 years," said physicist Scott Lucchini of the University of Wisconsin-Madison.

"We proposed a new solution with our models. The surprising part was that the models brought the stream much closer to the Milky Way."

In their earlier work, the team predicted that the Stream ought to be surrounded by a corona of warm gas. So, they performed new modelling incorporating that corona, as well as a new model for the clouds suggesting that they have only been orbiting each other for 3 billion years.

According to the team's new simulations, when the two dwarf galaxies started orbiting each other, they did so in the opposite direction from what astronomers previously thought. So, when they started stripping gas from each other, instead of arcing away from the Milky Way, the Magellanic Stream moved towards our galaxy.

This means that, at its closest, it's just 65,000 light-years away from Earth. Previous estimates put its distance at roughly 325,000 to 650,000 light-years away. This is a big deal. If the Stream is closer than we thought, we need to rethink its key properties.

"The revised distance changes our understanding of the stream," said astronomer Andrew Fox of the Space Telescope Science Institute. "It means our estimates of many of the stream's properties, such as mass and density, will need to be revised."

The results mean that the gas in the Magellanic Stream is likely to start colliding with the Milky Way sooner than we thought, injecting it with new material and generating shocks that will cause gas to clump together to form new stars. According to the team's calculations, this will start occurring in a short period of cosmic time – just 50 million years.

The findings also mean that astronomers have a new place to start looking for the stars that should be in the Magellanic Stream. These stars ought to have been removed from the Magellanic Clouds along with the gas, but so far only a few have been identified, and not conclusively. The team's model suggests that we've just been looking in the wrong place.

"It's shifting the paradigm of the stream," Lucchini said. "Some have thought the stars are too faint to see because they're too far away. But we now see that the stream is basically at the outer part of the disk of the Milky Way."

Future observations of that region could identify the stars from the Magellanic Stream, which in turn would confirm the team's findings.

The research has been published in The Astrophysical Journal Letters.