Great circles

Place two markers on the map. The great circle going through both markers is then drawn on the map. The markers can be dragged. Double click a marker to remove it.


This tool finds the geometric plane that goes through the centre of the Earth and the two marker points on the surface. It then finds where the rest of the Earth's surface intersects with this plane, and draws the intersection on the map. If the Earth were a perfect sphere, this intersection would be a great circle.

The Earth is not actually a perfect sphere, meaning that it does not actually have great circles. The closest analogy are geodesics, which can be thought of as the lines you would draw if you started at a point, picked a direction, and walked in that direction forever without turning. On a perfect sphere, all geodesics are great circles, and all great circles are geodesics. Since the Earth is quite close to a perfect sphere, and the method above would find a geodesic on a perfect sphere, I assume the lines it finds are quite close to geodesics on the actual Earth.

The calculations use the WGS84 model for the Earth, taking the Earth's semi-major axis as 6 378 137.0 m and the Earth's semi-minor axis as 6 356 752.314 245 m.

The plane is found by first converting the two coordinates on the Earth's surface to the Earth-centered, Earth-fixed (ECEF) coordinate system, using the equations found on Wikipedia. These converted coordinates are used to find the vectors pointing from the Earth's centre to the two points. The cross product of these two vectors gives a new vector that is normal to both previous vectors, and therefore also normal to the plane that goes through the Earth's centre and the two marker points.

This normal vector can then be used to find points on the Earth's surface that lie on the plane. If we rotate any of our marker vectors about the axis defined by the normal vector, the new, rotated vector also lies on the same plane. We can convert the vector into spherical coordinates to find the azimuth and elevation of the vector. Since this vector lies on the plane, we know that the point on the Earth's surface with the same azimuth and elevation (i.e. geocentric longitude and latitude) must also lie on the plane. However, since the Earth is an oblate spheroid, its geocentric and geodetic latitudes are generally not equal. In order to convert to geodetic latitude (i.e. the latitude used on maps), the equation found here is used.

The Javascript code on this page finds the great circle path by rotating the first placed marker 1 / 10 000th of a revolution to find the next point on the great circle. A line is then drawn between the marker and the next point. The next vector is then rotated another 1 / 10 000th in order to find a new point, and a line is drawn between these two points. This process is repeated 10 000 times in order to draw the full great circle path across the Earth's surface.