Compute the distance between two points in the plane from their coordinates.
计算二维平面上两点的距离。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Euclidean distance | d = sqrt( (x2 - x1)^2 + (y2 - y1)^2 ) | Euclid, Elements, Book I, Proposition 47 |
| Manhattan distance (contrast) | d1 = |x2 - x1| + |y2 - y1|, suited to grid-like paths | Krause EF, Taxicab Geometry: An Adventure in Non-Euclidean Geometry (1986) |
| Midpoint | M = ( (x1 + x2)/2, (y1 + y2)/2 ) | Euclid, Elements |
| Higher dimensions | In n dimensions, d = sqrt( sum (a_i - b_i)^2 ) | ISO 80000-2:2019, Quantities and units - Part 2: Mathematics |