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).
[tex]d= |9 - - 7| = |16| = 16[/tex]
Or
[tex]d = | - 7 - 9| = | - 16| = 16[/tex]
Note that this does not apply to points that are not parallel to the axes.