How do we write the derivation of distance formula of two points from two different quadrants in a cartesian plane? I learnt the derivation of the distance formula of two points in first quadrant I.e., $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$ where it is easy to find the legs of the hypotenuse (distance between two points) since the first has no negative coordinates and only two axes ($x$ coordinate and $y$ coordinate). while finding the distance between two points from two different quadrants of a Cartesian plane where four axes exist ($x$,$x_1$,$y$, $y_1$ coordinates), the same formula applies for this problem also. But, the derivation of the formula is based only on the distance between two points in first quadrant alone. Can you please explain the DERIVATION of the formula for more than two quadrants? Please

Consider the following diagram:
Now to find the wanted distance,By the Pythagorean theorem,we need to know the size of the Edges BC and AC.
Suppose A and B to be:$$A(x_1,y_1),B(x_2,y_2)$$
And to find AC ,We need to subtract the length of AD from CD. Observe that C has the y component equal to the point B. So:
$$AC =\vert(y_2 - y_1) \vert$$  In order to only have the length and not worry about its sign , we took  take the absolute value of this quantity.
  The same argument can be given for the length of BC. $$BC =\vert (x_2 - x_1) \vert$$. 
And now to use our friend Pythagoras. ABC is a right triangle,So:$${AB}^2={AC}^2+{BC}^2 $$,and with our last results,we have :
$$d=\sqrt{{\vert x_2-x_1\vert}^2 +{\vert y_2-y_1\vert}^2}$$
Now notice that square of absolute value of a number is just equal to the square of that number
(absolute value only changes the number's sign ,not size,and when you square that number,it's sign will be positive ,so they are equal.)
So we can drop the absolute values in our formula:
$$d= \sqrt{{(x_2-x_1)}^2 +{(y_2-y_1)}^2}$$

