[Math] Euclidean distance and dot product

linear algebravectors

I've been reading that the Euclidean distance between two points, and the dot product of the two points, are related. Specifically, the Euclidean distance is equal to the square root of the dot product. But this doesn't work for me in practice.

For example, let's say the points are $(3, 5)$ and $(6, 9)$. The Euclidean distance is $\sqrt{(3 – 6)^2 + (5 – 9)^2}$, which is equal to $\sqrt{9 + 16}$, or $5$. However, the dot product is $(3 * 6 + 5 * 9)$, which is $63$, and the square root of this is not $5$.

What am I getting wrong?

Best Answer

Apart of the other anwers, there is indeed a relation between Euclidean distance $d(X,Y)$ and the inner product $\langle X, Y \rangle$ if the vectors $X, Y \in \mathbb{R}^N$ are normalized, that is $\langle X, X \rangle=\langle Y, Y \rangle = 1$, in particular $$\frac{d(X,Y)^2}{2} = 1 - \langle X, Y \rangle.$$ This can be shown as $$d(X,Y)^2 = \langle X - Y, X - Y \rangle = \langle X, X \rangle + \langle Y, Y \rangle - 2 \langle X, Y \rangle = 2 (1 - \langle X, Y \rangle)$$

Related Question