Connect via MCP →

Enter Calculation

Default 6378.137 km (WGS-84 equatorial). Mean radius alternative: 6371.0 km.

East longitude and north latitude are positive; west longitude and south latitude are negative.

Formula

Formula: Great-Circle Distance & Bearing Calculator
Show calculation steps (1)
  1. Initial bearing (azimuth)

    Initial bearing (azimuth): Great-Circle Distance & Bearing Calculator

    Initial azimuth from A to B clockwise from true north, normalized to 0 to 360 degrees.

Advertisement

Results

Great-Circle Distance
9,491.28
kilometers
Azimuth from A to B 293.05°
Compass direction WNW

What is the Great-Circle Distance & Bearing Calculator?

This universal geodesy tool computes the shortest distance between two points on Earth (the great-circle distance) and the initial azimuth, or compass bearing, from point A toward point B. It models the Earth as a sphere, so it is not specific to any country or region. Enter coordinates as decimal degrees: east longitude and north latitude are positive, while west longitude and south latitude must be entered as negative values.

Sphere with two surface points connected by a curved great-circle arc and a straight chord for comparison
The great-circle arc is the shortest path between two points on a sphere.

How to use it

Type the longitude and latitude of point A and point B in decimal degrees. Set the Earth radius \(r\) in kilometers. The default 6378.137 km is the WGS-84 equatorial radius; many references instead use the mean radius 6371.0 km, which you can enter for the conventional value. Press calculate to see the distance in kilometers, the azimuth in degrees clockwise from true north, and the matching 16-point compass label.

The formula explained

Convert all coordinates to radians. Let \(\Delta\lambda\) be the longitude difference. The central angle is $$\Delta\sigma = \arccos\left(\sin\varphi_1 \sin\varphi_2 + \cos\varphi_1 \cos\varphi_2 \cos\Delta\lambda\right),$$ and the distance is \(r\cdot\Delta\sigma\). The initial bearing uses $$\theta = \operatorname{atan2}\!\big(\sin\Delta\lambda \cos\varphi_2,\ \cos\varphi_1 \sin\varphi_2 - \sin\varphi_1 \cos\varphi_2 \cos\Delta\lambda\big),$$ converted to degrees and normalized into the range 0 to 360.

Spherical triangle showing two points, their latitudes, longitude difference, and bearing angle
The formula uses latitudes, the longitude difference, and the bearing angle on a spherical triangle.

Worked example

From Tokyo (lon 139.74477, lat 35.6544) to Mecca (lon 39.8261, lat 21.4225) with \(r = 6378.137\) km: the central angle is about 1.4876 rad, giving a distance of roughly 9491 km. The bearing works out to about 293 degrees, i.e. WNW — the direction from Tokyo toward Mecca.

FAQ

Why does my result differ slightly from Google Maps? This uses a spherical Earth (one radius). Ellipsoidal methods like Vincenty differ by up to about 0.3%.

Which radius should I use? Use 6371 km for the common mean-radius convention, or 6378.137 km for the WGS-84 equatorial radius.

Why is the bearing blank for identical points? When A and B coincide the distance is zero and the bearing is mathematically undefined.

Last updated: