📏 Euclidean Distance Calculator

Compute the Euclidean distance and cosine similarity between two vectors. Used for feature similarity, nearest-neighbour checks and clustering analysis.

📐 计算公式 / 原理
欧氏距离 = √[Σ(aᵢ − bᵢ)²];曼哈顿距离 = Σ|aᵢ − bᵢ|;余弦相似度 = (a·b)/(‖a‖·‖b‖)
三种常用向量度量并列给出:欧氏看绝对位置差,受量纲影响需先标准化;曼哈顿按轴累加,在高维稀疏场景更稳;余弦只看夹角、忽略模长,因此常用于 embedding 与文本相似度比较。

📐 计算公式与说明

欧氏距离 = √Σ(aᵢ−bᵢ)²
余弦相似度 = A·B / (|A||B|)

余弦相似度范围为 [−1, 1]。