If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Distance formula

CCSS.Math:

## Video transcript

in this video we're going to learn how to take the distance between any two points in our XY in our XY coordinate plane we're going to see it's really just an application of the Pythagorean theorem so let's start with an example let's say I have the point I'll do the darker color so we can see it on the graph paper let's say have the point 3 comma negative 4 so if I were to graph it I'd go 1 2 3 and then I'd go down 4 1 2 3 4 right there is 3 comma negative 4 and let's say I also have the point 6 comma 0 6 comma 0 so 1 2 3 4 5 6 and then there's no movement in the y-direction we're just sit on the x axis the y coordinate is 0 so that's 6 comma 0 and what I want to figure out is the distance between these two points how far is this blue point away from this orange point and first you're like gee Sal I don't think I've ever seen anything about how to solve for a distance like this and what are you even talking about the Pythagorean theorem I don't see a triangle there and if you don't see a triangle let me draw it for you let me draw the triangle let me draw this triangle right there just like that let me actually do several colors here just to really hit the point home so there's our triangle and you might immediately recognize this is a right triangle this is a right angle right there does bass go straight left to right the right side goes straight up and down so we're dealing with a right triangle so if we could just figure out what the base length is and what this height is we could use the Pythagorean theorem to figure out this long side the side that is opposite the side that is opposite the right angle the hypotenuse this right here the distance the distance is the hypotenuse of this of this right triangle let me write that down the distance is equal to the hypotenuse hypotenuse of this right triangle so let me draw it a little bit bigger so this is the hypotenuse right there and then we have decide on the right the side that goes straight up and down and then we have our base now how do we figure out let's call let's call this D for distance that's the length of our hypotenuse how do we figure out the length of this up-and-down side and this the base side right here so let's look at the base first what is this distance you could even count it on this graph paper but here where it X is equal to we doing the green here where it X is equal to 3 and here where it X is equal to 6 right we're just moving straight right this is the same distance as that distance right there so to figure out that distance it's literally the end X point and you can actually go either way because we're going to square everything so it doesn't matter if you get negative numbers so it's going to be 6 it's going to be the distance here is going to be 6 minus 6 minus 3 right 6 minus 3 that's this distance right here which is equal to 3 so we figured out the base and just to remind ourselves that is equal to the change in X that was equal to your finishing X minus you're starting X 6 minus 3 this is our Delta X now by the same exact line of reasoning this height right here is going to be your change in Y that's going to be your change in Y up here at Y is equal to 0 that's kind of where you finish that's your high or Y point and over here you're at Y is equal to negative 4 so change in Y is equal to 0 minus negative 4 I'm just taking the larger Y value minus the smaller Y value the larger x value minus the smaller x value we're going to see where to square it in a second so even if you did it the other way around you get a negative number but you still get the same answer so this is equal to 4 so this side is equal to 4 you could even count it on the graph paper if you like and this side is equal to 3 and now we can do the Pythagorean theorem the Pythagorean theorem this distance this distance is the distance squared be careful the distance squared is going to be equal to this Delta x squared the change in x squared plus the change in Y squared plus the change in Y squared this is nothing fancy sometimes people will call this the distance formula it's just the Pythagorean theorem the this side squared plus that side squared is equal to hypotenuse squared because this is a right triangle so let's apply it with these numbers the numbers that we have at hand so the distance squared is going to be equal to Delta x squared is three squared plus Delta Y squared plus four squared which is equal to 9 plus 16 which is equal to 25 so the distance is equal to let me write that d square is equal to 25 D our distance is equal to you don't wanna take the negative square root because you can't have a negative distance and so only the principal root the positive square root of 25 which is equal to 5 so this distance right here is 5 or if we look at this distance right here that was the original problem how far is this point from that point it is 5 units away so what you'll see here this you know they call it the distance formula but it's just the Pythagorean theorem and just so you're exposed to all of the ways that you'll see the distance formula sometimes people will say oh if I have two points if I have one point let's call it x1 and y1 so that's just a particular point and let's say I have another point that is x2 comma y2 sometimes you'll see this formula that the distance you'll see it in different ways but you'll see that the distance is equal to it looks as this really complicated formula but I want you to see that this is really just the Pythagorean theorem you see that the distance is equal to x2 minus x1 minus x1 squared plus plus y2 y 2 minus minus y1 squared you'll see this written in a lot of textbooks as the distance formula distance formula and it's a complete waste of your time to memorize it because it's really just the Pythagorean theorem this is your change in X and it really doesn't matter which X you pick to be first or second because even if you get the negative of this value when you square it the negative disappears this right here is your change in Y so it's just saying that the distance squared remember if you square both sides of this equation the radical will disappear this will be the distance squared is equal to this expression squared Delta x squared change in X Delta means change in Delta x squared plus Delta Y squared don't want to confuse it Delta Y just means change in Y I should have probably said that earlier in the video but let's apply it to a couple of more and I'll just pick some points at random let's say I have the point let's see 1 2 3 4 5 6 negative 6 comma negative 4 negative 6 comma negative 4 and let's say I want to find the distance between that and 1 comma 1 2 3 4 5 6 7 and the point 1 comma 7 so I want to find this distance right here so it's the exact same idea we just use the Pythagorean theorem you figure out this distance which is our change in X this distance which is our change in Y this distance squared plus this distance squared is going to equal that distance squared so let's do it so our change in X you just take you could you know it doesn't matter I mean in general you want to take the larger x value minus the smaller x value but you could do it either way so we can write the distance squared is equal to what's our change in X so we can let's take the larger X minus the smaller X 1 minus negative 6 1 minus negative 6 squared plus the change in Y the larger Y is here it's 7 7 minus negative 4 7 minus negative 4 squared and I just pick these numbers random so they're probably not going to come out too cleanly so we get that the distance squared is equal to 1 minus negative 6 that is 7 7 squared and you'll even see it over here if you count it you go 1 2 3 4 5 6 7 that's that number right here that's what your change in X is plus 7 minus negative 4 that's 11 that's 11 this is this distance right here and you can count it on the blocks we're going up 11 we're just taking 7 - negative for to get a distance of 11 so plus 11 squared is equal to d squared so let me just take the calculator out so the distance the distance let's just take if we take seven squared plus 11 squared equal to 170 that distance is going to be the square root of that right d squared is equal to 170 so let's take the square root of 170 and we get 13 point Oh roughly 13 point o4 so this distance right here we tried to figure out is 13 0.04 hopefully you found that helpful