Coordinate geometry is the arithmetic that turns field observations into positions and positions back into stakeout instructions. There is not much of it. Two operations, the inverse and the forward, generate nearly everything else: a traverse is a chain of forwards, a closure check is a sum of their components, an area is a sum of cross products, and an intersection is two forwards constrained to meet.
What makes COGO error-prone is not the mathematics but the conventions. Plane surveying puts north first and measures angles clockwise from north; almost every mathematics text, and almost every graphics library, does the opposite on both counts. Get one of those backwards and the arithmetic still runs, the answers still look like coordinates, and the result is wrong in a way that is hard to see.
This page works through the whole core with numbers you can check. Every figure below comes from the same computation library that drives the calculators on this site, so if you reproduce a table by hand and get a different answer, the discrepancy is real and worth chasing.
Coordinates: northing first
A plane survey coordinate is an ordered pair of a northing and an easting, written in that order. The northing is the distance north of the origin of the coordinate system; the easting is the distance east of it. Both are ordinarily kept positive by placing the origin far to the south and west of the working area, which is why State Plane coordinates are large numbers.
- Northing-first convention
- Coordinates are stated as (N, E). This is the reverse of the mathematical (x, y) ordering, where the horizontal coordinate comes first. Northing corresponds to y and easting to x, so a coordinate pair handed to a plotting routine expecting (x, y) must be swapped, not passed through.
The convention is not arbitrary. Direction in surveying is measured from north, so putting the north component first keeps the coordinate order and the angle reference consistent: the first coordinate is the one the zero of the azimuth points along. Every sign rule that follows depends on that alignment holding.
Azimuths and bearings
An azimuth is a direction measured clockwise from north, from 0° to 360°. A quadrant bearing is the same direction expressed as an acute angle from the nearer meridian, prefixed by north or south and suffixed by east or west: N 26°15′00″ E, S 61°18′00″ E, and so on. Azimuths are what you compute with; bearings are what deeds and plats are written in, so you need both and you need to move between them without thinking.
| Azimuth range | Quadrant | Bearing angle |
|---|---|---|
| 0° to 90° | NE | azimuth |
| 90° to 180° | SE | 180° − azimuth |
| 180° to 270° | SW | azimuth − 180° |
| 270° to 360° | NW | 360° − azimuth |
Worked both ways on four directions, one in each quadrant:
| Azimuth | Bearing |
|---|---|
| 26°15′00″ | N 26°15′00″ E |
| 118°42′00″ | S 61°18′00″ E |
| 205°30′00″ | S 25°30′00″ W |
| 291°15′00″ | N 68°45′00″ W |
| 161°20′00″ | S 18°40′00″ E |
| 222°15′30″ | S 42°15′30″ W |
| 286°54′40″ | N 73°05′20″ W |
The back azimuth of a line is the forward azimuth plus 180°, wrapped into the range 0° to 360°. The back bearing is the same acute angle with both letters reversed: the back bearing of N 26°15′00″ E is S 26°15′00″ W. Reversing a direction is required at every station of a traverse, and doing it by adding 180° to an azimuth is less error-prone than manipulating letters.
One habit worth forming: convert every bearing to an azimuth as soon as you read it, do all the computation in azimuths, and convert back only for the deliverable. The quadrant rules are four separate cases and each is a chance to pick the wrong one; azimuth arithmetic is one case.
The inverse
The inverse takes two known points and returns the distance and direction from the first to the second. It is the operation behind every closure check, every check shot, and every as-built comparison.
ΔN = N₂ − N₁ ΔE = E₂ − E₁
D = √(ΔN² + ΔE²)
α = atan2(ΔE, ΔN)Take point A at northing 1,000.00, easting 2,000.00 and point B at northing 1,500.00, easting 2,400.00.
| Quantity | Value |
|---|---|
| ΔN | +500.00 ft |
| ΔE | +400.00 ft |
| Distance | 640.31 ft |
| Azimuth | 38.659808° = 38°39′35.31″ |
| Bearing | N 38°39′35.31″ E |
| Back azimuth | 218°39′35.31″ |
Why atan2(ΔE, ΔN) and not atan2(ΔN, ΔE)
The two-argument arctangent in every programming language and on every scientific calculator is defined for the mathematical convention: atan2(y, x) returns the angle measured counter-clockwise from the positive x axis. Surveying measures clockwise from north. North is the second coordinate, east is the first in the mathematical sense — so to get a surveying azimuth you must feed the easting difference where the routine expects y and the northing difference where it expects x.
correct: α = atan2(ΔE, ΔN) = atan2(400.00, 500.00) = 38.659808°
wrong: α = atan2(ΔN, ΔE) = atan2(500.00, 400.00) = 51.340192°Swapping the arguments reflects the direction about the 45° line, so the wrong answer is the complement of the right one. That is what makes the error so persistent. The result is a perfectly plausible azimuth in the same quadrant, it changes sensibly when you change the input, and it agrees with the correct value whenever the line happens to run at 45°. Nothing about it looks broken until a coordinate lands in the wrong place.
The reason to use a two-argument arctangent at all, rather than atan(ΔE / ΔN), is quadrant resolution. A single-argument arctangent returns a value between −90° and +90° and cannot distinguish a line running northeast from one running southwest, because the ratio is identical. The two-argument form sees both signs and resolves all four quadrants; you then add 360° to any negative result to normalise it.
A check in the third quadrant: from northing 5,000.00, easting 5,000.00 to northing 4,700.00, easting 4,550.00, ΔN is −300.00 and ΔE is −450.00. The distance is 540.83 ft and the azimuth is 236.309932°, which is 236°18′35.76″, or S 56°18′35.76″ W. Both components negative means the line runs into the southwest quadrant, and the azimuth confirms it. Feeding a single-argument arctangent the ratio 450/300 would have returned 56.31° and lost the quadrant entirely.
The forward
The forward computation is the inverse run backwards: from a known point, a direction and a distance, it produces the coordinates of the new point. This is the operation that lays out a traverse and the one behind every stakeout computation.
N₂ = N₁ + D · cos α
E₂ = E₁ + D · sin αThe pairing of cosine with northing is the single thing to remember, and it follows directly from measuring the angle from north: at an azimuth of zero the whole distance is northing, and cos 0° is 1 while sin 0° is 0. In the mathematical convention, where the angle is measured from the east axis, the pairing is the other way round. Any code or spreadsheet that pairs sine with the first coordinate has imported the wrong convention.
From B at northing 1,500.00, easting 2,400.00, on an azimuth of 128°30′00″ for 425.60 ft:
| Quantity | Value |
|---|---|
| D · cos α | −264.942 ft |
| D · sin α | +333.078 ft |
| Northing | 1,235.058 ft |
| Easting | 2,733.078 ft |
The negative northing component is not an error; an azimuth of 128°30′00″ runs southeast, so the point moves south and east. Sign discipline is the whole of the forward computation. If you let the trigonometric functions produce the signs from the full azimuth, rather than working with a bearing angle and applying signs by hand from the quadrant letters, the signs are correct automatically and you have removed a class of mistakes.
Latitudes and departures
The two components of a course have names of their own. The latitude is the north–south component and the departure is the east–west component; they are precisely the two terms of the forward computation, given their own names because a traverse sheet tabulates them separately.
latitude = D · cos α (+ north, − south)
departure = D · sin α (+ east, − west)Latitude here has nothing to do with geographic latitude. The word is older than the coordinate system and means the north–south reach of a line. Keeping the two senses apart is a matter of context, and the plural gives it away: a traverse has latitudes, a globe has latitude.
The value of the decomposition is that components add. Whatever route a traverse takes, the sum of its latitudes is its total northward reach and the sum of its departures is its total eastward reach. On a loop that returns to its starting point, both sums must be zero — and that is the closure check.
Traverse closure
Take a four-sided closed traverse: four courses observed in the field, running from A back round to A.
| Course | Azimuth | Bearing | Distance (ft) | Latitude (ft) | Departure (ft) |
|---|---|---|---|---|---|
| A–B | 45°00′00″ | N 45°00′00″ E | 300.00 | +212.132 | +212.132 |
| B–C | 120°00′00″ | S 60°00′00″ E | 250.00 | −125.000 | +216.506 |
| C–D | 208°28′45″ | S 28°28′45″ W | 269.84 | −237.187 | −128.670 |
| D–A | 296°33′54″ | N 63°26′06″ W | 335.47 | +150.026 | −300.054 |
| Totals | 1,155.31 | −0.0283 | −0.0855 |
The two totals are the closures in latitude and departure. They should be zero and they are not, because measurements are never perfect. Their resultant is the linear misclosure — the straight-line distance between where the traverse computed the closing point and where the closing point actually is.
e = √(ΣLat² + ΣDep²) = √(0.0283² + 0.0855²) = 0.090084 ft
precision = 1 : (ΣD / e) = 1 : (1,155.31 / 0.090084) = 1:12,824Precision is reported as a ratio with the numerator fixed at one, and the denominator is rounded down rather than to nearest. A traverse computing 1:12,824.8 is quoted as 1:12,824, because rounding a precision upward claims accuracy that was not achieved. A specification calling for 1:10,000 is met here comfortably.
Area by coordinates
Once a parcel is expressed as an ordered list of coordinates, its area is a fixed computation with no judgement in it. The coordinate method, often called the shoelace formula from the pattern of its cross multiplications, sums the cross products around the boundary.
2A = Σ (Eᵢ · Nᵢ₊₁ − Eᵢ₊₁ · Nᵢ)The double-meridian-distance method is the same computation arranged for hand work, and it is what a plat computation sheet traditionally shows. It accumulates a meridian distance for each course and multiplies by that course's latitude.
DMD₁ = dep₁
DMDᵢ = DMDᵢ₋₁ + depᵢ₋₁ + depᵢ
2A = Σ (DMDᵢ · latᵢ)Worked on a five-sided parcel: A at 5,000.00 / 5,000.00, B at 5,286.42 / 5,122.15, C at 5,190.60 / 5,480.33, D at 4,905.75 / 5,560.20, and E at 4,812.30 / 5,210.44, all northing first.
| Course | Latitude (ft) | Departure (ft) | DMD (ft) | DMD × latitude (sq ft) |
|---|---|---|---|---|
| A–B | +286.42 | +122.15 | 122.15 | +34,986.20 |
| B–C | −95.82 | +358.18 | 602.48 | −57,729.63 |
| C–D | −284.85 | +79.87 | 1,040.53 | −296,394.97 |
| D–E | −93.45 | −349.76 | 770.64 | −72,016.31 |
| E–A | +187.70 | −210.44 | 210.44 | +39,499.59 |
| Totals | 0.00 | 0.00 | −351,655.12 |
The double area is −351,655.12 sq ft, so the area is half its magnitude: 175,827.56 sq ft, which is 4.0364 acres at 43,560 sq ft to the acre. The shoelace formula applied to the same five coordinates returns 175,827.56 sq ft as well, as it must.
Two checks fall out of the sheet for free. The latitude and departure columns must each total zero, because the boundary closes; if they do not, the coordinate list is not a closed figure and the area is meaningless. And the sign of the double area tells you which way round the vertices are listed — negative here, meaning the boundary runs clockwise on a north-up plan, which is the ordinary direction of a walked boundary.
Intersections
An intersection finds a point from two constraints instead of from a direct measurement to it. Three forms cover almost all practical work: two directions, two distances, and one of each.
Direction–direction
Given a point and an azimuth from each of two control stations, the intersection is where the two lines cross. From A at 5,000.00 / 5,000.00 on an azimuth of 65°00′00″, and from C at 5,190.60 / 5,480.33 on an azimuth of 10°00′00″, the intersection is at northing 5,226.972, easting 5,486.743. Checking back, that point is 537.062 ft from A on 65°00′00″ and 36.933 ft from C on 10°00′00″.
The computation fails when the two directions are parallel, and it degrades badly when they are nearly parallel: a small error in either azimuth then moves the intersection a long way along the lines. The angle of intersection is therefore part of the design of the observation, not an accident of it. Keep it well away from zero, and prefer something in the region of a right angle where the geometry allows.
Distance–distance
Given a distance from each of two known points, there are two solutions — the two places where the circles cross — and the arithmetic cannot tell you which one you want. From A at 5,000.00 / 5,000.00 at 400.00 ft, and from C at 5,190.60 / 5,480.33 at 350.00 ft, the two solutions are northing 5,360.114 / easting 5,174.120 and northing 4,857.251 / easting 5,373.661.
Choosing between them requires information from outside the computation: which side of the line joining the control points the target lies on, or an approximate position, or a third observation. Software conventionally reports the solution to the left of the direction from the first point to the second first, but a convention is not evidence. If the two circles fail to reach each other, or one lies wholly inside the other, there is no solution at all and the distances contain a blunder.
Checks that catch the common errors
- Inverse every course you computed forward. The distance and azimuth must come back to the values you started from. This catches transcription errors immediately and costs seconds.
- Check the quadrant against the signs of ΔN and ΔE before believing an azimuth. Both positive is northeast, positive north with negative east is northwest, and so on. If the azimuth disagrees with the signs, the arguments are swapped.
- Sum latitudes and departures separately on any closed figure. Both must come to zero within the misclosure. A column that is far off while the other is fine points at a single bad course rather than at accumulated error.
- Compute area two ways. The coordinate method and the double-meridian-distance method must agree exactly; a disagreement means the vertex list is out of order or not closed.
- Check that your calculator is in degrees. Radians produce results that are wrong by a factor of about 57 and are usually caught, but grads produce results wrong by ten per cent and frequently are not.
- Carry full precision through intermediate steps and round once at the end. Rounding a latitude to two decimals before summing a twelve-course traverse can shift the misclosure enough to change the reported precision ratio.
- State the units and the coordinate system on everything. A coordinate without a datum, a zone and a unit is a number, not a position.
None of this is difficult, and that is precisely the risk. COGO errors survive because the arithmetic is easy enough that people stop checking it, and because the wrong answers look exactly like right ones. The conventions — northing first, azimuth clockwise from north, easting first into the arctangent, cosine with the northing — are worth over-learning, because they are the only part of the subject that does not announce itself when you get it wrong.