The line from the point (5,5) to (5,1) has length 4 units. 
We can just subtract 5 -1= 4 or in other word (y2-y1)

The line from the point (2,1) to (5,1) has length 4 units.  
We can just subtract 5 - 2 = 3 or in other word (x2-x1)

By the theorem pythagoras we know that the hypoteneuse2=sum of squares of other two sides.  (Pythagoras theorem examples)

In the diagram we can see that one of the sides is the difference in the height of the point =y2-y1
The other side is the difference in the distance across =x2-x1
So the side or the hypoteneuse is equal to the sum of the squares of the other 2 sides 
 hyp2 = (x2-x1)2 +  (y2-y1)2
Therefore if we get the square root of both sides we get the distance formula.

 

 


Exercise