# What is meant by the double vertical line notation here?

What do the double vertical lines around $\vec i$ and $\vec j$ in this equation actually mean?

$$sim(i,j) = cos(\vec i, \vec j) = \frac{\vec i \cdot \vec j}{\lVert \vec i\rVert^2 * \lVert\vec j\rVert^2}$$

• Length of a vector. – Artem Apr 6 '14 at 16:09
• Or similarly $\|\vec{i}\|^2=\vec{i}\cdot\vec{i}$ so $\|\vec{i}\|=\sqrt{\;\vec{i}\cdot\vec{i}}$ – snulty Apr 6 '14 at 16:24
• It's not "double \mid" but rather \| (or a double || if anything else). The command \mid is a separator; whereas | and \| are not. The difference is in the spacing. – Asaf Karagila Apr 6 '14 at 18:14
• Actually, it should be \lVert + \rVert. \| has the problem that it's unclear whether TeX should treat it as a mathopen or mathclose. – kahen Apr 6 '14 at 18:30
• Thanks guys, I'm new to TeX so please excuse the newbie mistakes – conorgriffin Apr 6 '14 at 21:29

When discussing real or complex vectors, you often also have real or complex numbers in the conversation. If these things are represented symbolically, every little thing you can do to remind the reader which symbols represent vectors and which symbols represent numbers is good. For example, the meaning of $\left|a\right|\left|v\right|$ is not as clear as that of $\left|a\right|\left|\vec{v}\right|$, and it's even more clear to write $\left|a\right|\left\|\vec{v}\right\|$.
Incidentally, \left\|...\right\| looks better than \mid\mid...\mid\mid. Compare $\left\|\vec{v}\right\|$ to $\mid\mid\vec{v}\mid\mid$.