You can use the absolute value method to find the distance between two points that are on the same horizontal line or vertical line.
For example
The distance between
(2,-7) and (2,9).

Or

Note that this does not apply to points that are not parallel to the axes.