Finding the length between two points in 3 Dimensions with Pythagorean's Theorem I am a grade 11 student and I have to learn vectors for the IB exam. I know that to find the distance of a vector between two points in a 3 dimensional space for lets say point A and B, then you would use the formula 
\begin{align*}
|AB|=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_2)^2}.
\end{align*}
I am having difficulty visualizing and understanding why the coordinates of the points are being subtracted here. I really appreciate the feedback.
Sorry for the low quality of the link, but I guess I don't have enough reputation yet to insert images directly. Also, in the formula all the subscripts should be reversed. So x1 becomes x2 and vice versa.
 A: The subtraction represents the distance between two points (along an axis). Along the $x$-axis, for example, the distance from $3$ to $7$ is $4$:
$$|3-7| = |7-3| = 4.$$
For Pythagoras's theorem, you need the lengths of the sides of the triangles; these are $|x_1-x_2|$ and $|y_1-y_2|$ (as well as $|z_1-z_2|$ if you generalize the theorem into three dimensions). Note that the order of subtraction doesn't matter, and when we square these quantities, the absolute value signs become redundant.
A: I'm assuming you know why the distance between $(x_1, y_1)$ and $(x_2,y_2)$ is $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$
Refer to the picture below

Clearly, the vecctor representing $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$ lies in the $XY$ plane.
$z_2-z_1$ lies on the $Z$ axis.
The normal vector to the $XY$ plane is $(0,0,k)$, indicating that the vector representing $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$ and $z_2-z_1$ are perpendicular.
Now, you have two vectors i.e  $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$ and $z_2-z_1$ which are mutually perpendicular and hence you can apply the Pythagorean's Theorem here.
This gives distance between $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ =  $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2+(z_1-z_1)^2}$
