They’re figured out by the shortest path across the Earth. It uses a speed of 500mph for most planes. They also add time for take-offs, landings, and taxiing.