Distance Along Grid Lines
Introduction
Welcome to the first of four lessons in Distance Between Two Points. Earlier coordinate-plane lessons taught you to read signed coordinates; now you’ll use them to measure direct paths between points that line up horizontally or vertically. The key clue is that one coordinate stays the same.
One Coordinate Stays Fixed
Picture a city map where records east-west position and records north-south position. Moving straight east or west changes while stays fixed; moving straight north or south changes while stays fixed.
The shared coordinate tells you the direction of the segment. The coordinate that changes tells you which values to compare:
| Segment | Coordinate that stays fixed | Coordinate used to find distance |
|---|---|---|
| Horizontal | ||
| Vertical |
Distance is a length, so it cannot be negative. Taking the absolute value makes the result nonnegative, regardless of which endpoint you start from: .
Horizontal Distance
For a horizontal segment, the -coordinates match, so find the absolute difference between the -coordinates:
Suppose each grid unit on a city map represents one block. Shops at and are on the same horizontal street because their -coordinates match. Their distance is:
The shops are 5 coordinate units apart, or five blocks on this map.

Vertical Distance
For a vertical segment, the -coordinates match, so find the absolute difference between the -coordinates:
On a coordinate floor plan, imagine doorways at and along the same vertical hallway. Their shared -coordinate confirms the segment is vertical, and the distance is:
The doorways are 5 coordinate units apart. Even though both -coordinates are negative, the distance is positive.

Crossing an Axis
Crossing an axis does not change the method. It means a coordinate passes through ; use the absolute difference of the changing coordinates as usual.
The horizontal segment from to crosses the -axis. Its distance is:
The gap covers 4 units from to and 3 more units from to . The vertical segment from to crosses the -axis, and its distance is:
Reversing the subtraction gives the same distance: . The subtraction order can change the sign inside the absolute value, but the distance remains 9 coordinate units.
If the two points coincide, both coordinate differences are zero, so their distance is 0 units. The same rule still works.
Conclusion and Next Steps
For a horizontal segment, keep fixed and use ; for a vertical segment, keep fixed and use . In either case, take the absolute value to get a nonnegative distance in coordinate units, no matter which endpoint comes first.
In the practice that follows, you’ll identify grid-aligned shop pairs, complete absolute-difference steps, and calculate distances along a hallway. Check for the shared coordinate first, then compare only the coordinate that changes. Mastering horizontal and vertical distances gives you the building blocks for diagonal segments and the full distance formula in later lessons.
