Find the distance between $u$ and $v$

5.4k Views Asked by At

Find the distance between $u$ and $v$ Where $u = [1,2,3]$ and $v = [-1,0,1]$

Am I calculating the norm of both vectors and substracting them together?

Thank you very much

2

There are 2 best solutions below

0
On BEST ANSWER

Try it with the example $[0,0,0]$ and $[1,0,0]$.

The norms are $0$ and $1$ and the distance now can either be $-1$ or $1$ (problematic).

Reversing the order of your operations leads to calculating the norm of either $[1,0,0]$ or $[-1,0,0]$ which both is $1$.

0
On

Given $u=[1,2,3]$ and $v=[-1,0,1]$

The distance between $u$ and $v$ is $$d(u,v)=\sqrt{(1-(-1))^2+(2-0)^2+(3-1)^2}$$ $$d(u,v)=\sqrt{(2)^2+(2)^2+(2)^2}=\sqrt{12}=2\sqrt{3}$$