Checking distances and slopes after translating coordinates
Shift both endpoints of a segment by the same offset and the distance and slope stay the same. This guide shows why, and what breaks the rule.
What a translation does to a segment
A translation moves every point by one fixed vector. If you add 10 to every x value and subtract 2 from every y value, a point at (0, 0) lands at (10, -2) and a point at (3, 4) lands at (13, 2). The segment slides across the plane without turning or stretching. Because distance and slope are computed from the differences between the endpoints, and both endpoints received the same shift, those differences are untouched. This is the reason surveyors can move an origin, game developers can reposition a sprite, and students can simplify a problem by placing one endpoint at (0, 0). The result is a quick consistency check as well: if a distance changes after a pure shift, an offset was applied unevenly.
The algebra in two lines
Write the endpoints as (x1, y1) and (x2, y2) and the shift as (h, k). After the shift they become (x1 + h, y1 + k) and (x2 + h, y2 + k). The new horizontal difference is (x2 + h) - (x1 + h), and h cancels to leave x2 - x1. The same cancellation removes k from the vertical difference. The distance formula, the square root of the squared differences, therefore returns the original value, and the slope, which is the vertical difference divided by the horizontal difference, returns the original ratio. The cancellation holds for negative offsets and for decimals alike, and it works in three dimensions with a third offset in the same way.
Reading the default case on the distance calculator
The base segment runs from (0, 0) to (3, 4). Its differences are 3 and 4, so the distance calculator returns the square root of 9 + 16, which is 5. After the shift by (10, -2) the endpoints are (10, -2) and (13, 2). The differences are still 3 and 4, and the distance is again 5. The slope calculator gives (2 - (-2)) / (13 - 10) = 4/3, which prints as 1.3333333333333333 with the display precision shown on the worked case. Writing the negative y value in parentheses when you subtract avoids the most common slip, which is dropping the sign and getting a vertical difference of 0 instead of 4.
A second segment with a different shift
Take the segment from (1, 2) to (7, 10). The differences are 6 and 8, so the distance is 10 and the slope is 8/6, or 1.3333. Shift both endpoints by (100, -50) to get (101, -48) and (107, -40). The differences are still 6 and 8, so the distance remains 10 and the slope remains 1.3333. A shift of (-5, 7) applied to the first example gives (-5, 7) and (-2, 11), whose distance is again 5. Large offsets such as 100 are useful in practice because map and CAD coordinates often sit far from the origin, and subtracting a local origin first keeps the numbers small and the arithmetic easier to read.
What changes when only one endpoint moves
Shifting just one end changes the segment. Keep the first point at (0, 0) and move only the second from (3, 4) to (13, 2). The differences become 13 and 2, so the distance is the square root of 173, about 13.153, and the slope is 2/13, about 0.1538. Neither matches the original 5 and 1.3333. This is the usual source of a failed translation check: a spreadsheet formula applied to the x and y columns of one point but not the other, or an offset added to the wrong column. When a distance moves after a supposed shift, compare the new differences with the old ones to find which endpoint was left behind.
Scaling and rotation are different operations
Translation is one of several transformations, and only some preserve distance. Scaling every coordinate by 2 turns (0, 0) to (3, 4) into (0, 0) to (6, 8). The slope stays at 1.3333, but the distance doubles to 10. A rotation by any angle keeps the distance, yet it generally changes the slope, because the segment now points in a new direction. A reflection keeps the distance and flips the sign of one difference, which changes the sign of the slope. Translation is the only one of these that preserves both quantities, which makes it the safest operation to use when you want to relocate a shape without altering its measurements.
Vertical segments and undefined slopes
The slope formula divides by the horizontal difference, so a vertical segment has no defined slope. The points (2, 1) and (2, 6) have a horizontal difference of 0, and the division fails. A translation preserves this too: shifting both points by (10, -2) gives (12, -1) and (12, 4), still a vertical segment with distance 5 and still no slope. The distance remains well defined because it never divides. If you need a slope-like description of a vertical line, state that it is vertical or use the angle with the horizontal axis, 90 degrees, rather than forcing a number out of a division by zero.
Translating a whole shape or a list of points
The same idea extends beyond one segment. A triangle with vertices (0, 0), (4, 0) and (0, 3) has side lengths 4, 3 and 5. Adding (6, 6) to every vertex gives (6, 6), (10, 6) and (6, 9), and each side keeps its length because each pair of vertices shares the same shift. The area also survives, because a translation moves a shape rigidly. In a spreadsheet, the practical rule is to add the offsets to a whole column at once rather than point by point, then recompute a few distances against the originals. If the two sets agree, the shift was applied evenly. If one value differs, the row with the mismatch is the one that missed the offset.
Axes that must share one unit
The invariance depends on Cartesian axes that are perpendicular and use the same length unit on both. A map projection with different scales in each direction, or a plot whose axes are stretched, changes the result of the formulas without changing the idea. The calculators also treat the points as positions on a flat plane, so geographic latitude and longitude require a different method, and the straight segment ignores any road, wall or curve between the points. The worked cases confirm arithmetic on supplied numbers. They do not determine which coordinate system a data set uses, and that should be confirmed from its documentation.
Reproduce the checks
Original distance
Open the Distance Calculator and enter:
- First x coordinate
0- First y coordinate
0- Second x coordinate
3- Second y coordinate
4
Expected output:
distance
5The coordinate differences are three and four.
Translated distance
Open the Distance Calculator and enter:
- First x coordinate
10- First y coordinate
-2- Second x coordinate
13- Second y coordinate
2
Expected output:
distance
5The same offsets cancel in both differences.
Translated slope
Open the Slope Calculator and enter:
- First x coordinate
10- First y coordinate
-2- Second x coordinate
13- Second y coordinate
2
Expected output:
slope
1.3333333333333333The rise and run are unchanged.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- MathWorld ↗ · 2026-10-08
- MathWorld ↗ · 2026-10-08