Flying straight from A to B may be the fastest distance, but this is only true on a 2D map, while the Earth is not flat.
There are many reasons for planes not flying in a straight line from A to B, but two of the biggest have to do with the Earth’s surface and atmospheric currents.
The Earth is spherical, spinning itself around its axis, so the equatorial part “swells”. Therefore, the circumference of the planet around the equator is much larger than at higher or lower latitudes, narrowing gradually towards the poles. This means that the distance when the plane moves towards the poles is shorter than when it is traveling directly to the equator. That is why flights from the US to Asia often go through Alaska and Siberia instead of flying in a straight line, both shortening travel time and saving fuel.
Routes are mapped out before departure to choose the shortest and most effective route. Planes can change flight paths during travel, depending on weather, wind and atmospheric currents (or ray currents).
The wind speed in the atmospheric stream can reach more than 320km / h, and can bring an aircraft to its destination faster, using less fuel. Conversely, if an aircraft is upstream of the atmosphere, the pilot will need to fly in a different direction.
Air turbulence is also a determining factor in an airplane’s trajectory. The main cause of the disturbance is heat rising from the ground. Water dissipates heat better than the ground, so the air on water is less turbulent than on land. This explains why many routes are designed around the sea, instead of flying directly over land.
Currently, the flight from Singapore to Newark, New Jersey, USA is the longest continuous flight in the world ever recorded: a journey of more than 16,700 km lasting 18 hours and 45 minutes.