The given points are P (X1, Y1 ) and Q (X2, Y2 )
(i) When PQ is parallel to the y-axis, x1 = x2.
In this case, distance between P and Q √(( X2 -X1 )2 + ( Y2 -Y1 )2 )

(ii) When PQ is parallel to the x-axis, y1 = y2.
In this case, distance between P and Q =√((X2 - X1)2 + (Y2 - Y1)2)
