Euclidean distance

The Distance Formula

Very often, especially when measuring the distance in the plane, we use the formula for the Euclidean distance. According to the Euclidean distance formula, the distance between two points in the plane with coordinates (x, y) and (a, b) is given by.
dist((x, y), (a, b)) = √(x – a)² + (y – b)²
As an example, the (Euclidean) distance between points (2, -1) and (-2, 2) is found to be

  dist((2, -1), (-2, 2)) = √(2 – (-2))² + ((-1) – 2)²
    = √(2 + 2)² + (-1 – 2)²
    = √(4)² + (-3)²
    = √16 + 9
    = √25
    = 5.


The source of this formula is in the Pythagorean theorem.