Product of diference between a transpose vector and a vector To title of information,
$\textbf{z}$ is a vector that have three components $[z_R, z_G, z_B]$ 
$\textbf{a}$ is a vector that have three components $[a_R, a_G, a_B]$
The Euclidian distance between them is given by,
$$ D(\textbf{z}, \textbf{a}) = \Arrowvert \textbf{z} - \textbf{a} \Arrowvert \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1)$$
$$ D(\textbf{z},\textbf{a}) = \left[ (\textbf{z} - \textbf{a})^T (\textbf{z} - \textbf{a}) \right]^{\frac{1}{2}} \ \ \ \ \ \ \ (2)$$ 
$$D(\textbf{z}, \textbf{a}) = \left[ (z_R - a_R)^2 + (z_G - a_G)^2 + (z_B - a_B)^2 \right]^{\frac{1}{2}}  \ \ \ \ (3)$$
The point I'm wondering is how do I get $(2)$ from $(1)$ ?
Also, the reason why $(3)$ can not be used even knowing that is more straightforward.
 A: (2) is (3) just using vector operations.  Since each vector is treated like  a single column matrix, $(\mathbf{z}-\mathbf{a})^T(\mathbf{z}-\mathbf{a})$ gives the sum of each $(z_i -a_i)$ for $i$ from 1 to 3 via multiplication of a row vector (from the transpose) by a column vector
$$
(\mathbf{z}-\mathbf{a})^T(\mathbf{z}-\mathbf{a}) = \begin{bmatrix} z_R-a_R & z_G-a_G & z_B-a_B\end{bmatrix}\begin{bmatrix}z_R-a_R \\ z_G-a_G \\ z_B-a_B\end{bmatrix}
$$ 
$$
= (z_R-a_R)^2 + (z_G-a_G)^2 + (z_B-a_B)^2 
$$
So you can see that
$$
\begin{bmatrix}(\mathbf{z}-\mathbf{a})^T(\mathbf{z}-\mathbf{a})\end{bmatrix}^\frac{1}{2} = 
\begin{bmatrix} (z_R-a_R)^2 + (z_G-a_G)^2 + (z_B-a_B)^2 \end{bmatrix}^\frac{1}{2}
$$
A: It is just the same:
$$ \left[(\textbf{z} -\textbf{a})^T(\textbf{z} -\textbf{a} )\right]^{1\over 2} = \left[[z_R - a_R, z_G - a_G, z_B - a_B]^T[z_R - a_R, z_G - a_G, z_B - a_B]\right]^{1\over 2} $$$$= \left[(z_R - a_R)^2 + (z_G - a_G)^2 +(z_B - a_B)^2\right]^{1\over 2} = || \textbf{z} - \textbf{a} || $$
