In this video, we are going to talk about how to find the distance between two points and also how to understand how the formula works. So let’s begin.

So let’s say if we want to find the distance between the point (1, 2, -5) and the second point which is (4, 6, 7). So what’s a simple way to find the distance between these two points? What formula do we need to use?

So the distance formula that we are going to use looks like this. It is the square difference of the x values and it’s the square of the difference between the y values plus the square difference of the z values, and then we will have to take the square root of that entire result. So this is going to be x1, 2 is y1, -5 is z1 and in the second point 4 is going to be x2, 6 is y2 and 7 is z2.

Now if you want to try this problem yourself, feel free to go ahead and do so. Now let’s begin. So we said that x2 is 4, x1 is 1, y2 is 6, y1 is 2, z2 is 7 minus z1 which is -5. So we have 4 minus 1 which is 3, and then here we have 6 minus 2 which is 4, and then 7 minus -5 which is 7 plus 5 which is 12. Let’s get rid of that. 3 squared is 9, 4 squared is 16, and 12 squared or 12 times 12 is 144.

Now 144 plus 16, that’s 160 plus 9, so this is the square root of 169 which works out to be 13. And that’s a simple way in which you can find the distance between two points in three dimensions where you have x, y, and z.

Now let’s plot these two points so we can understand another way in which we can get the answer just to see it visually. So this is going to be the z-axis, and here we have the y-axis, and this is the x-axis. Now let’s begin by plotting the first point. So we have an x-value of 1, a y-value of 2, and a z-value of -5. So we need to go below towards the negative z direction.

Now, if we travel one unit along the x-axis and then draw a parallel line, a parallel dashed line along the y-axis, and then starting from the point (0, 2, 0) on the y-axis, let’s draw a parallel line to the x-axis, we get this point of intersection. And from here, what we could do is go down approximately 5 units along the z-direction. Let’s say this is 1, 2, 3, 4, 5. So I know it’s not perfect, but let’s say the point is somewhere in that region. So that would be the first point where we have an x-value of 1, a y-value of 2, and a z-value of -5. So let’s call this P1.

Now let’s plot the second point. So x is 4, y is 6. So here’s 6 on the y-axis, 4 on the x-axis. Now starting with the point on the x-axis, let’s draw a dashed line that’s parallel to the y-axis. And starting with this point, let’s draw a line that’s parallel to the x-axis and let’s highlight this point of intersection. Now from this point, let’s draw a line or dashed line parallel to the z-axis, and let’s go up 7 units. Now I’m going to ballpark it, for the sake of this lesson, it doesn’t have to be perfect for the concept that I want to teach here. So let’s say that’s the second point.

So as a review, we traveled 4 units along the x-axis and then, as you can see, 6 units along the y-axis and approximately 7 units parallel to the z-axis. Now, how can we find the distance between these two points visually? We know the answer is 13, but let’s show it.

Now, if you look at the two points along the x-axis, we traveled from 1 to 4, so basically, you could say that we traveled 3 units this way. Now I’m running out of space, so this line is going to be pretty short. And for the y-values, we went from 2 to 6. So we traveled along the positive y-axis, you could say about 4 units to the right, or rather exactly 4 units, not about 4 units. And then after that, going from -5 to 7, we traveled up parallel to the z-axis 12 units. And so that’ll take us to this point. So let me write down these numbers. So this is 3, 4, and 12.

Now I’m going to draw a line parallel to the y-axis and one parallel to the x-axis, and it forms a parallelogram. Now notice that this is a right triangle. So if this side is 3 and this side is 4, the hypotenuse of that right triangle has to be 5 based on the Pythagorean theorem, a squared plus b squared is c squared. So 3 squared plus 4 squared is 5 squared.

Now what I’m going to do at this point is draw another parallelogram. So starting with P1, I’m going to draw a line that’s parallel to the z-axis, and then another one that’s parallel to this line. So notice that this xy-plane that we drew is perpendicular to this plane. And so what that means is that this is a right angle. And so if we draw the diagonal of this plane, it’s going to make a right triangle. And so we’re going to have a 5, 12, 13 right triangle because 5 squared plus 12 squared is 13 squared.

Now let’s explain it using variables. So let’s say the first point is the origin, and we’re going to travel x units, so let’s just call this x, and then y units parallel to the y-axis, and then up z units. So once again, we can draw a right triangle, and let’s call this L, the hypotenuse of x and y. So let’s call that L. So we can say that x squared plus y squared is equal to L squared. And then we know that here is, this is a right angle, so we can draw another triangle. And so this is going to be the distance d between P1, which we define to be the origin, and P2. So that’s the distance between those two points. And as you can see, we have another right triangle between L, z, and d. So since d is the hypotenuse for that second right triangle, we can say that L squared plus z squared is d squared.

Now what we need to do is replace L squared with x squared plus y squared. So let’s substitute L squared with that, and so that gives us x squared plus y squared plus z squared is equal to d squared. And then if we take the square root of both sides, this gives us the basis for forming the distance formula.

Now because P1 was defined to be the origin, we only have x. But let’s say if it wasn’t the origin, then x would really be the difference between the x values in P1 and P2. Same thing for y. So y would be the difference between the y values of P1 and P2. And so instead of having this equation, we are going to have this equation. And so that’s all I want to do today is show you how this formula can be derived using geometry and right triangles.