Assume the following setup, taken from this source.
I will omit the arrows from now on. Then the projection of $v$ onto $s$ is given by \begin{align} proj_v = \frac{ \langle v,s \rangle}{\langle s,s\rangle} s \end{align}
I have a simulation, where I want to compute the projection of multiple points onto one line. Assume, that my points can be reached via $v_1,v_2,...,v_N$. Then define $V=(v1,...,v_N)\in \mathbb{R}^{Dim\times N}$ where $Dim$ is either 2 or 3. I should then obtain \begin{align} proj_V = \frac{V^Ts}{\langle s,s\rangle} s \end{align} But $V^Ts\in \mathbb{R}^{N\times 1}$ and $s\in \mathbb{R}^{Dim \times 1}$. So this doesn't match. Do I simply take \begin{align} proj_V =s \left(\frac{V^Ts}{\langle s,s\rangle} \right)^T \end{align} which would be in $Dim \times N$.
The reason, why I want to follow this approach is , that it would allow me to make use of fast matrix vector multiplication instead of iterating over all points. Thanks!