Hotmath
Math Homework. Do It Faster, Learn It Better.

The Distance Formula

You know that thedistance A B between two points in a plane withCartesiancoordinates A ( x 1 , y 1 ) and B ( x 2 , y 2 ) 由以下公式给出:

A B = ( x 2 x 1 ) 2 + ( y 2 y 1 ) 2

The distance formula is really just thePythagorean Theorem在伪装。

To calculate the distance A B between point A ( x 1 , y 1 ) and B ( x 2 , y 2 ) , first draw a right triangle which has the segment A B ¯ as its hypotenuse.

If the lengths of the sides are a and b , then by the Pythagorean Theorem,

( A B ) 2 = ( A C ) 2 + ( B C ) 2

Solving for the distance A B , we have:

A B = ( A C ) 2 + ( B C ) 2

Since A C is a horizontal distance, it is just the difference between the x -coordinates: | ( x 2 x 1 ) | . Similarly, B C is the vertical distance | ( y 2 y 1 ) | .

Since we're squaring these distances anyway (and squares are always non-negative), we don't need to worry about those absolute value signs.

A B = ( x 2 x 1 ) 2 + ( y 2 y 1 ) 2

Example:

Find the distance between points A and B in the figure above.

In the above example, we have:

A ( x 1 , y 1 ) = ( 1 , 0 ) , B ( x 2 , y 2 ) = ( 2 , 7 )

so

A B = ( 2 ( 1 ) ) 2 + ( 7 0 ) 2 = 3 2 + 7 2 = 9 + 49 = 58

or approximately 7.6 units.