Suppose you have a $2\times 1$ column vector $x=[7,2]^{T}$. How would you find $||x||^{2}$? Would it be $7^{2} + 2^{2}$? Is this equivalent to the distance from the origin?
Asked
Active
Viewed 2.7k times
7
-
There are various definitions of distance. The one you used is the Euclidean distance, which is the square root of the sum of the squares of the components. Your computation is correct, and it is the Euclidean distance from the origin to $(7,2)^T$. – copper.hat Apr 19 '13 at 01:16
-
The result is a number though not a matrix? – phil12 Apr 19 '13 at 01:22
-
Correct, a distance is always a non-negative number. – copper.hat Apr 19 '13 at 02:30
1 Answers
7
Yes, for a $t \times 1 $ vector $x$, we have $\|x\| = \sqrt{\sum_{i=1}^t |x_i|^2}$, where $x_i$ is the $i$th component of $x$, and $\|\cdot\|$ is the usual Euclidean distance. $\|x\|$ (not $\|x\|^2$) is the distance of $x$ to the origin. You may verify this via the Pythagorean theorem. Draw your 2D vector $[x_1\, x_2]^T$ and calculate its distance to the origin.
Lord Soth
- 7,750
- 20
- 37