Staring out over the vastness of the ocean, it feels like the distant blue horizon goes on forever and ever. But it doesn't, and you can't.

If you were to set sail in a straight line from the shore – never turning once to steer your way around islands or continents – what's the furthest you could you go before making a voyage-ending, inevitable landfall?

We now have an answer to this sea-faring riddle, thanks to science.

In actual fact, we've held the answer in our hands for some time, although the source of the solution remained unconfirmed – not to mention a little bit mysterious.

In 2012, Reddit user kepleronlyknows posted a map on Reddit that he claimed was the longest straight line you could trace across Earth's oceans: a trek of almost 20,000 miles (32,186 km) in a straight line from Pakistan to the Kamchatka Peninsula, Russia.

041 sail straight line earth 3(Chabukswar and Mukherjee)

A pretty fascinating hypothesis, but the question remained, was it true? Nobody knew for sure.

For his part, kepleronlyknows also made a video of what this epic voyage would look like – at least from a Google Earth perspective – but admitted he didn't come up with the beginning-and-end coordinates, saying he stumbled upon them from a Wikipedia entry on 'Extreme points of Earth'.

As for who originally came up this pair of extreme points, it's unclear, but – leaving that aside for now – what about the straight line anyway? Is the Pakistan-to-Russia trip the actual furthest straight line you could ever sail?

Yes, it is, according to a new pre-print paper by physicist Rohan Chabukswar and engineer Kushal Mukherjee from the United Technologies Research Centre in Ireland and IBM Research, India, respectively.

Their curiosity piqued by kepleronlyknows' post, Chabukswar and Mukherjee sourced data from the National Oceanic and Atmospheric Administration's ETOPO1 Global Relief model of Earth's surface – the closest approximation they could get to a 3D map of land and water covering all of Earth's surface, limited to a spatial resolution of about 1.8 kilometres.

041 sail straight line earth 3(Chabukswar and Mukherjee)

Using this data, they realised it would be too time-consuming to compute the points of every single 'great circle' looping around the globe – a feat that would involve calculating some 230 million world-spanning loops (such as the equator), and involving trillions of data points to consider.

Instead, they used an algorithm called 'branch and bound' to cut down the possibilities but still lead them to the answer, which is: yes, the longest straight line you could sail does indeed take you from Pakistan to Russia (or vice versa).

This 32,089.7-kilometre (19,939.6 mile) trek originates in Sonmiani, Las Bela, Balochistan, Pakistan, before "threading the needle" between Africa and Madagascar, then continuing on between Antarctica and Tiera del Fuego in South America, finally arriving in Karaginsky District, Kamchatka Krai, Russia.

This trajectory might not seem to be straight if you're thinking of rectangular maps, but that's because rectangular representations are of course only an approximation of the globular (not flat) planet we live on, which can lead to lots of surprising results when you're imagining just where the horizon might lead.

041 sail straight line earth 3(Chabukswar and Mukherjee)

Going one better, the researchers also calculated the longest straight line you could ever drive on land, which they say is an epic roadtrip starting in Jinjiang, Quanzhou, Fujian, China, which takes you through a total of 15 countries, finally depositing you at Sagres, Portugal.

That long haul covers 11,241.1 kilometres (6,984.9 miles), but before you start filling up your gas tank, you may want to bear in mind the researchers' final piece of travel advice.

"The problem was approached as a purely mathematical exercise," they write in their paper.

"The authors do not recommend sailing or driving along the found paths."

The findings are available at arXiv.org.