跳到主要内容

资源 · 指南或文章

Euclidean Distance

点与点之间欧几里得距离的简短参考,从勾股定理推导而来,并从一维推广到 n 维。适合几何和最近点类问题。

审核日期

打开原站: Euclidean Distance (在新标签页中打开原网站)

添加到路线图

把这个资源放进你正在跟进的路线图。它会作为你自己的补充资源显示;路线图的步骤不会改变,也不计入你已记录的步骤。

来源内容语言:英语

In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefore occasionally being called the Pythagorean distance. The distance between any two points on the real line is the absolute value of the numerical difference of their coordinates In three dimensions, for points given by their Cartesian coordinates, the distance is

PrepKit 概览

本概览由 PrepKit 编辑根据源代码仓库撰写并审核,并非资源本身的文字。

适合人群
来源未说明适用级别
形式
参考资料

涵盖内容

  • 一维、二维、三维以及一般 n 维情形的公式
  • 以点 (8,2,6) 和 (3,5,7) 为例的三维演算

使用建议

这是 PrepKit 的学习建议,并非来源的说法。

写一个适用于任意维度点的函数,用 (8,2,6) 和 (3,5,7) 检验,然后用距离的平方找出最近的 k 个点。

范围与局限

所有公式和三维示例都是来自维基百科和 MathIsFun 的图片,单看文字所获有限。没有讨论其他度量方式或数值精度。

获取方式与形式

GitHub 上采用 MIT 许可的 trekhleb/javascript-algorithms 仓库中的免费英文 README。

PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88

本概览的依据
  • src/algorithms/math/euclidean-distance/README.md

收录此条目的页面

订阅 PrepKit 通讯

可选。使用 PrepKit 并不需要订阅。

我们如何处理你的邮箱