平面两点距离计算器

d = √((x₂−x₁)² + (y₂−y₁)²)

Compute the distance between two points in the plane from their coordinates.

📐 计算公式
平面两点距离(二维欧氏距离):d = √((x₂−x₁)² + (y₂−y₁)²);联动量:Δx = x₂−x₁、Δy = y₂−y₁ 两个坐标差。校验:无强校验,空值按 0 兜底。判据:无固定分级,距离即横纵坐标差平方和的平方根(勾股定理),结果保留四位小数。

计算二维平面上两点的距离。

Formula & Standard References

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
📌 计算说明
  • (0,0)→(3,4) 距离 5。
  • 勾股数 3-4-5。

📚 深度解析:二维两点距离

💡 常见使用场景

平面距离
A(1,2), B(4,6):距离=√[(4-1)²+(6-2)²]=√(9+16)=√25=5。即勾股定理在平面上的直接应用。
与曼哈顿距离
同样两点曼哈顿距离=|4-1|+|6-2|=7,比欧氏距离 5 大;路径只能横竖走时用曼哈顿更合适。

❓ 常见问题(FAQ)

欧氏距离和曼哈顿距离区别?
欧氏是直线(√(Δx²+Δy²)),曼哈顿是横竖折线(|Δx|+|Δy|)。前者适合自由空间,后者适合网格街道。
三维距离怎么算?
加一维即可:√[(x2-x1)²+(y2-y1)²+(z2-z1)²],原理相同。