I am currently studying principal component analysis in statistics. PCA uses the "projection of $\mathbf{X}$ in the direction of $\mathbf{a}$":
$$\mathbf{a}^T \mathbf{X} = \sum_{j = 1}^d a_j X_j$$
I know that $\dfrac{\mathbf{a} \cdot \mathbf{b}}{\vert \vert\mathbf{b} \vert \vert} = \vert \vert \mathbf{a} \vert \vert \cos(\theta)$ is the vector $\mathbf{a}$ in the direction of the vector $\mathbf{b}$, but I'm struggling to see how $\mathbf{a}^T \mathbf{X} = \sum_{j = 1}^d a_j X_j$ is $\mathbf{X}$ in the direction of $\mathbf{a}$. Analogously to the $\dfrac{\mathbf{a} \cdot \mathbf{b}}{\vert \vert\mathbf{b} \vert \vert} = \vert \vert \mathbf{a} \vert \vert \cos(\theta)$ case, how is $\mathbf{a}^T \mathbf{X} = \sum_{j = 1}^d a_j X_j$ $\mathbf{X}$ in the direction of $\mathbf{a}$?
When we talk about PCA, $a$ here is a unit vector.
If $x$ is a vector, then $$\frac{x \cdot a}{\|a\|}=\frac{x\cdot a}{1}=x\cdot a =a^Tx$$