What is a Bearing?
A bearing is a direction of one point relative to another point, usually given as an angle measured clockwise from north. In navigation, bearings are often used to determine the direction to a destination or to plot a course on a map. There are two main types of bearings: absolute bearing and relative bearing.
Use this interactive map to calculate the bearing and distance between two coordinates
Bearing from Point 1 to Point 2: degrees
Distance between points: km
Instructions:
Click anywhere on the map to place Point 1 and Point 2. These points represent two locations between which you wish to measure the bearing and distance.
After placing the points, you can drag Point 1 or Point 2 to adjust their positions. The bearing and distance will automatically update based on their new locations.
Click the “Clear Points” button to remove the current points and start over with new locations.
What the Results Represent:
Bearing: This is the direction from Point 1 to Point 2 in degrees, measured clockwise from the north. A bearing of 0° means Point 2 is directly north of Point 1, 90° means east, 180° means south, and 270° means west.
Distance: This is the straight-line distance between Point 1 and Point 2, measured in kilometers, calculated using the Haversine formula, which accounts for the curvature of the Earth.
Absolute bearing
Absolute bearing refers to the angle between the magnetic north (magnetic bearing) or true north (true bearing) and an object. For example, an object due east would have an absolute bearing of 90 degrees.
Relative bearing
Relative bearing refers to the angle between the forward direction of a craft (heading) and the location of another object. For example, an object with a relative bearing of 0 degrees would be immediately in front of the craft, while an object with a relative bearing of 180 degrees would be behind it.
For example, if you are standing at point A and you want to go to point B, the bearing from A to B is the direction that you would need to follow to get to B from A. Bearings are often used in navigation to determine the direction to a destination or to plot a course on a map.
Bearings can be measured in degrees, with 0 degrees being north, 90 degrees being east, 180 degrees being south, and 270 degrees being west. Bearings can also be expressed as a three-figure number, with the first digit representing the direction of the tens of degrees, the second digit representing the direction of the units of degrees, and the third digit representing the direction of the minutes. For example, a bearing of 045 degrees would be expressed as 045, and a bearing of 122 degrees would be expressed as 122.
Here are a few other terms that are sometimes used instead of Bearing
- Heading: This term is often used to describe the direction that a vehicle, such as a boat or an airplane, is currently traveling in.
- Course: This term is similar to heading, but it can also refer to the intended direction of travel, rather than the current direction.
- Orientation: This term refers to the position or alignment of something in relation to its surroundings.
- Direction: This term refers to the way that something is facing or the path that it is moving in.
- Compass bearing: This term is used to describe the direction of one point relative to another point, measured in degrees clockwise from north, as indicated by a compass.
- Angle: This term refers to describing the direction to a destination.
How to calculate a Bearing between two coordinates
The Haversine equation is a formula used to calculate the great-circle distance between two points on the surface of a sphere (such as the Earth), given their latitudes and longitudes. This method accounts for the curvature of the Earth, providing an accurate measurement over large distances.
Haversine Formula:
a = sin2(Δφ / 2) + cos(φ1) * cos(φ2) * sin2(Δλ / 2)
c = 2 * atan2( √a, √(1−a) )
d = R * c
Where:
- ( \phi_1 ) and ( \phi_2 ) are the latitudes of the two points (in radians).
- ( \lambda_1 ) and ( \lambda_2 ) are the longitudes of the two points (in radians).
- ( \Delta \phi = \phi_2 – \phi_1 ) is the difference in latitude.
- ( \Delta \lambda = \lambda_2 – \lambda_1 ) is the difference in longitude.
- ( R ) is the radius of the Earth (mean radius ≈ 6,371 km).
- ( d ) is the distance between the two points.
Step-by-Step Explanation:
- Convert the latitudes and longitudes from degrees to radians.
- Calculate the differences in the latitudes and longitudes.
- Apply the Haversine formula to compute the distance in terms of angular distance (in radians).
- Multiply the result by the radius of the Earth to get the actual distance.
How to calculate a Bearing between two coordinates in Python
import math
def calc_bearing(lat1, long1, lat2, long2):
# Convert latitude and longitude to radians
lat1 = math.radians(lat1)
long1 = math.radians(long1)
lat2 = math.radians(lat2)
long2 = math.radians(long2)
# Calculate the bearing
bearing = math.atan2(
math.sin(long2 - long1) * math.cos(lat2),
math.cos(lat1) * math.sin(lat2) - math.sin(lat1) * math.cos(lat2) * math.cos(long2 - long1)
)
# Convert the bearing to degrees
bearing = math.degrees(bearing)
# Make sure the bearing is positive
bearing = (bearing + 360) % 360
return bearing
How to calculate a Bearing between two coordinates in Microsoft Excel
To calculate the bearing between two coordinates (latitude and longitude) in Excel, you can use the following formula, which involves some trigonometry.
Formula:
Assume:
- Point 1 (latitude, longitude):
Lat1
,Lon1
- Point 2 (latitude, longitude):
Lat2
,Lon2
- All coordinates are in decimal degrees.
You can use the following formula in Excel to calculate the bearing:
=MOD(ATAN2(SIN(RADIANS(Lon2-Lon1)) * COS(RADIANS(Lat2)), COS(RADIANS(Lat1)) * SIN(RADIANS(Lat2)) - SIN(RADIANS(Lat1)) * COS(RADIANS(Lat2)) * COS(RADIANS(Lon2-Lon1))), 2*PI()) * 180/PI()
Explanation:
- RADIANS: Converts degrees to radians since Excel’s trigonometric functions use radians.
- ATAN2: Calculates the arc tangent of two variables, used here to compute the bearing.
- MOD: Ensures the result is within the range 0°–360°.
- Multiply by 180/PI(): Converts the result from radians back to degrees.
Example:
If your data is in cells:
A2
(Latitude 1)B2
(Longitude 1)A3
(Latitude 2)B3
(Longitude 2)
You would use the following formula:
=MOD(ATAN2(SIN(RADIANS(B3-B2)) * COS(RADIANS(A3)), COS(RADIANS(A2)) * SIN(RADIANS(A3)) - SIN(RADIANS(A2)) * COS(RADIANS(A3)) * COS(RADIANS(B3-B2))), 2*PI()) * 180/PI()
This will return the bearing from Point 1 to Point 2 in degrees, measured clockwise from the north.
How to calculate a Bearing between two coordinates in QGIS
In QGIS, there are several tools that you can use to calculate the bearing between two points.
One option is to use the $bearing
function in an expression. This function takes two point geometries as arguments and returns the bearing in degrees clockwise from north. You can use the $bearing
function to create a new field in the attribute table that contains the bearings, or to display the bearings on the map canvas using labels or data-defined symbology.
Another option is to use the “Measure Azimuth” tool in the “Measure” toolbar. To use this tool:
- Open the “Measure” toolbar by going to View > Toolbars > Measure.
- Select the “Measure Azimuth” tool.
- Click on the starting point of the measurement.
- Click on the ending point of the measurement.
The bearing will be displayed in the Measurements panel, as well as on the map canvas as a line connecting the two points.
You can also use the “Measure Line” tool to measure the distance between the two points and the “Measure Angle” tool to measure the angle between the line and north.