MathorynMathematical Formula Database

Analytic Geometry

Distance Formula

The distance formula gives the straight-line distance between two points in the plane. It is the Pythagorean theorem applied to the horizontal and vertical differences.

d=(x2−x1)2+(y2−y1)2d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
LaTeXd=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

Variables

(x1,y1), (x2,y2)(x_1,y_1),\ (x_2,y_2)
the two points
dd
distance

Example

Distance between (1,2)(1,2) and (4,6)(4,6).

  1. 32+42=25\sqrt{3^2+4^2}=\sqrt{25}.

Answer: d=5d=5.

Related formulas