Home › Survey calculations › Bearing and distance
Bearing and distance between two points
Enter the coordinates of two points: the bearing, the horizontal distance and, if you give the elevations, the height difference and the slope appear immediately, with the step-by-step calculation. It is the “inverse problem” of surveying.
Result
How to use the calculator
- Enter the coordinates X, Y of the two points, in metres, in the same system (UTM, Lambert…). You can paste “X Y” or “N X Y Z” from Excel into the X box: the fields fill in by themselves.
- Add the elevations Z if you want the height difference, the slope distance and the slope.
- Choose the angle unit at the top: gon, degrees or DMS.
The bearing formula
The bearing GAB is the angle measured clockwise from grid north (the Y axis) to the direction A → B. With ΔX = XB − XA and ΔY = YB − YA :
- Distance D = √(ΔX² + ΔY²)
- Acute angle g = arctan(|ΔX| / |ΔY|)
- The quadrant gives the bearing:
| Signs | Quadrant | Bearing (gon) | Bearing (degrees) |
|---|---|---|---|
| ΔX ≥ 0, ΔY > 0 | 1 (north-east) | G = g | G = g |
| ΔX ≥ 0, ΔY < 0 | 2 (south-east) | G = 200 − g | G = 180 − g |
| ΔX < 0, ΔY < 0 | 3 (south-west) | G = 200 + g | G = 180 + g |
| ΔX < 0, ΔY > 0 | 4 (north-west) | G = 400 − g | G = 360 − g |
On a calculator, the function Pol (rectangular → polar) gives the distance and an angle to bring between 0 and 400 gon directly. Careful: it often expects (ΔY; ΔX) in that order, because mathematicians measure angles from the X axis.
Example
A (486,298.080; 362,191.330; Z 520.40) and B (486,412.550; 362,105.870; Z 512.85), in Merchich Lambert. Tap Example to find it in the calculation.
- ΔX = +114.470 m ; ΔY = −85.460 m ; D = √(114.470² + 85.460²) = 142.852 m
- g = arctan(114.470 / 85.460) = 59.1734 gon; ΔX > 0 and ΔY < 0: quadrant 2, so G = 200 − 59.1734 = 140.8266 gon
- Back bearing G(B→A) = 140.8266 + 200 = 340.8266 gon
- Height difference ΔZ = −7.55 m; slope = −7.55 / 142.852 = −5.29 %; slope distance 143.052 m
Frequently asked questions
How do you calculate a bearing from two points?
Calculate ΔX = XB − XA and ΔY = YB − YA, then the acute angle g = arctan(|ΔX| / |ΔY|). Depending on the signs of ΔX and ΔY, the bearing is g, 200 − g, 200 + g or 400 − g in grads (or 180 and 360 in degrees).
What is the difference between bearing and azimuth?
The bearing is measured from grid north of the projection (Y axis of the grid), the azimuth from true north. The difference between the two, the meridian convergence, ranges from a few tenths of a degree to more than a degree depending on the position.
Is the bearing in grads or degrees?
In Morocco and France, surveyors mostly work in grads (gon): a full circle is 400 gon. The tool also calculates in decimal degrees and in degrees-minutes-seconds: choose the unit at the top of the calculation.
What is the back bearing?
It is the bearing from B to A: forward bearing ± 200 gon (or ± 180°). For example, if G(A→B) = 140.8266 gon, then G(B→A) = 340.8266 gon.